sgl-project/sglang · error · ValueError

f"No safetensors files found in {component_model_path}"

Error message

f"No safetensors files found in {component_model_path}"

What it means

After resolving the model class, the bridge loader globs the component directory for *.safetensors files. If none are found it raises this ValueError, because there are no weights to load into the bridge model.

Source

Thrown at python/sglang/multimodal_gen/runtime/loader/component_loaders/bridge_loader.py:64

            server_args.pipeline_config, self.pipeline_bridge_config_attr, None
        )
        if bridge_config is not None:
            bridge_config.update_model_arch(config)
        else:
            # Create a minimal config from hf_config
            from sglang.multimodal_gen.configs.models.bridges.mova_dual_tower import (
                MOVADualTowerConfig,
            )

            bridge_config = MOVADualTowerConfig()
            bridge_config.update_model_arch(config)

        model_cls, _ = ModelRegistry.resolve_model_cls(class_name)

        # Find all safetensors files
        safetensors_list = _list_safetensors_files(component_model_path)
        if not safetensors_list:
            raise ValueError(f"No safetensors files found in {component_model_path}")

        default_dtype = resolve_precision(
            server_args, component_name, precision_attr="dit_precision"
        )

        logger.info(
            "Loading %s from %s safetensors files, default_dtype: %s",
            class_name,
            len(safetensors_list),
            default_dtype,
        )

        use_fsdp = server_args.should_use_fsdp_for_component(component_name)
        component_starts_on_cpu = server_args.should_start_component_on_cpu(
            component_name
        )

        # Use the FSDP loader when FSDP is requested or shard rules are declared.

View on GitHub (pinned to 0132848349)

Solutions

  1. Verify the directory actually contains *.safetensors files: ls <component_model_path>
  2. Convert .bin checkpoints to safetensors or re-export the component with a recent diffusers/transformers version
  3. Fix the component path in server args to point at the directory that holds the safetensors shards
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

st = list(Path(component_model_path).glob("*.safetensors"))
assert st, f"no safetensors in {component_model_path}"

Prevention

When it happens

Trigger: load_customized on a directory containing only .bin/.pt checkpoints, an empty weights folder, or a subdirectory layout (e.g. a nested subfolder holding the safetensors) that the glob doesn't cover.

Common situations: Checkpoint downloaded partially (weights missing); weights stored in pytorch_model.bin format from an older export; wrong path given so the directory exists but has no weight files.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/017cae12bf0a6d95. Report an issue: GitHub.