{"record":{"id":"c90c3ced1b62b8e6","repo":"sgl-project/sglang","slug":"no-safetensors-files-found-in-quantized-path-or-c","errorCode":null,"errorMessage":"no safetensors files found in {quantized_path or component_model_path}","messagePattern":"no safetensors files found in (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/transformer_load_utils.py","lineNumber":690,"sourceCode":"        safetensors_list = _list_safetensors_files(component_model_path)\n\n    if safetensors_list:\n        # Diffusers repos occasionally ship more than one shard split for the\n        # same checkpoint (e.g. a 4-way and an 8-way split side by side). The\n        # index file is the authoritative source for which files belong to\n        # the checkpoint that was actually exported; anything else is a\n        # leftover sibling variant.\n        safetensors_list = filter_duplicate_safetensors_files(\n            safetensors_list,\n            os.path.dirname(safetensors_list[0]),\n            SAFE_WEIGHTS_INDEX_NAME,\n        )\n\n    safetensors_list = _prefer_mixed_safetensors_files(safetensors_list)\n    safetensors_list = _filter_duplicate_precision_variant_safetensors(safetensors_list)\n\n    if not safetensors_list:\n        raise ValueError(\n            f\"no safetensors files found in {quantized_path or component_model_path}\"\n        )\n\n    return safetensors_list\n\n\ndef _prefer_mixed_safetensors_files(safetensors_list: list[str]) -> list[str]:\n    \"\"\"Prefer mixed-precision transformer exports over sibling full exports.\n\n    Some raw ModelOpt NVFP4 repos ship both `foo-mixed.safetensors` and\n    `foo.safetensors`. They are alternative full transformer exports, not\n    shards, so loading both trips duplicate tensor-name validation.\n    \"\"\"\n    mixed_files = [\n        path\n        for path in safetensors_list\n        if _MIXED_SAFETENSORS_RE.match(os.path.basename(path))\n    ]","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/transformer_load_utils.py#L672-L708","documentation":"After collecting, mixed-export-preferencing, and duplicate-precision filtering the safetensors file list for the transformer, the list is empty, so there is nothing to load.","triggerScenarios":"resolve_transformer_safetensors_to_load finds no *.safetensors in quantized_path or component_model_path, or the found files were all filtered out as duplicate precision variants, or a cached HF repo snapshot is empty.","commonSituations":"Model directory containing only .bin/pytorch_model files, an incomplete HF download/cache, or a repo exporting multiple precision variants that the dedup filter removes entirely.","solutions":["Check the model path actually contains .safetensors shards (ls the dir)","Re-download the model or clear the stale HF cache snapshot","If the repo has mixed precisions, ensure at least one non-duplicate safetensors variant remains selectable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\nfiles = list(Path(model_dir).rglob('*.safetensors'))\nif not files:\n    raise SystemExit(f'no safetensors in {model_dir}; re-download or convert the checkpoint')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-check the model directory for .safetensors shards before launch","Clear stale/empty HF cache snapshots when downloads fail midway"],"tags":["safetensors","checkpoint","file-not-found"],"backgroundTag":"missing-model-weights","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}