{"record":{"id":"ee82e852b097e4f1","repo":"sgl-project/sglang","slug":"weight-file-source-filename-r-was-not-found-in","errorCode":null,"errorMessage":"Weight file {source.filename!r} was not found in {source.repo_id}","messagePattern":"Weight file (.+?) was not found in (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/weights/source.py","lineNumber":174,"sourceCode":"    if subfolder is not None:\n        subfolder = _validate_relative_hub_path(subfolder, \"subfolder\")\n    return WeightSource(\n        original=source,\n        kind=\"huggingface\",\n        repo_id=repo_id,\n        revision=revision,\n        subfolder=subfolder,\n        filename=filename,\n    )\n\n\ndef _filter_inventory_files(\n    files: tuple[str, ...], source: WeightSource\n) -> tuple[str, ...]:\n    if source.filename is not None:\n        selected = tuple(path for path in files if path == source.filename)\n        if not selected:\n            raise FileNotFoundError(\n                f\"Weight file {source.filename!r} was not found in {source.repo_id}\"\n            )\n        return selected\n    if source.subfolder is None:\n        return files\n    prefix = source.subfolder.rstrip(\"/\") + \"/\"\n    selected = tuple(path for path in files if path.startswith(prefix))\n    if not selected:\n        raise FileNotFoundError(\n            f\"Weight subfolder {source.subfolder!r} was not found in {source.repo_id}\"\n        )\n    return selected\n\n\ndef resolve_weight_inventory(source: WeightSource) -> WeightInventory:\n    \"\"\"List source files and pin a remote source to an immutable revision.\"\"\"\n    if source.kind == \"local\":\n        assert source.local_path is not None","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/weights/source.py#L156-L192","documentation":"After listing the repo's files, the resolver filters for the exact filename requested via the URL or WeightSource and finds no match in the repo at the pinned revision. The file simply is not present under that name in that repo/revision.","triggerScenarios":"Passing an exact file URL for a file that does not exist in the repo; filename case mismatch; the file only exists on a different revision (branch) than the pinned one.","commonSituations":"File renamed between revisions; using resolve/main for a file that lives on a feature branch; misspelled or case-different filename.","solutions":["List the repo files (e.g. huggingface_hub.list_repo_files) to confirm the exact path","Fix the filename spelling/case in the URL","Pin the correct revision that contains the file"],"exampleFix":"# before\nparse_weight_source(\"org/repo/resolve/main/model.safetenors\")\n# after\nparse_weight_source(\"org/repo/resolve/main/model.safetensors\")","handlingStrategy":"validation","validationCode":"from huggingface_hub import list_repo_files\n\nfiles = list_repo_files(repo_id, revision=rev)\nassert desired_filename in files, f\"{desired_filename} not in repo\"","typeGuard":null,"tryCatchPattern":"try:\n    inv = resolve_weight_inventory(src)\nexcept FileNotFoundError as e:\n    logger.error(\"weight file missing: %s\", e)\n    raise","preventionTips":["Pin revisions whose file lists you have verified","Check exact filename case against the repo listing"],"tags":["huggingface","weights","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}