{"record":{"id":"da114814ba44e6e4","repo":"sgl-project/sglang","slug":"weight-subfolder-source-subfolder-r-was-not-foun","errorCode":null,"errorMessage":"Weight subfolder {source.subfolder!r} was not found in {source.repo_id}","messagePattern":"Weight subfolder (.+?) was not found in (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/weights/source.py","lineNumber":183,"sourceCode":"    )\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\n        local_path = Path(source.local_path)\n        if not local_path.exists():\n            raise FileNotFoundError(f\"Weight path does not exist: {local_path}\")\n        if local_path.is_file():\n            files = (local_path.name,)\n        else:\n            files = tuple(\n                path.relative_to(local_path).as_posix()\n                for path in sorted(local_path.rglob(\"*\"))","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/weights/source.py#L165-L201","documentation":"The requested subfolder prefix matches zero files in the repo inventory at the pinned revision. The subfolder filter is applied after filename filtering when no explicit filename was given.","triggerScenarios":"Passing 'owner/repo/subfolder' where subfolder does not exist in the repo; trailing-slash or case mismatch in the subfolder; subfolder removed in the pinned revision.","commonSituations":"Repo layout changed between versions; typos in subfolder names; expecting a folder that only exists in a fork.","solutions":["List repo files and check the exact subfolder spelling/case","Update the subfolder to the new layout or pin a revision where it exists","Drop the subfolder to inspect the full file list first"],"exampleFix":"# before\nresolve_weight(\"org/repo/flux-dev\")\n# after\nresolve_weight(\"org/repo/FLUX.1-dev\")","handlingStrategy":"validation","validationCode":"from huggingface_hub import list_repo_files\n\nprefix = subfolder.rstrip(\"/\") + \"/\"\nassert any(f.startswith(prefix) for f in list_repo_files(repo_id, revision=rev))","typeGuard":null,"tryCatchPattern":"try:\n    inv = resolve_weight_inventory(src)\nexcept FileNotFoundError as e:\n    logger.error(\"subfolder missing: %s\", e)\n    raise","preventionTips":["Verify subfolder spelling/case against the repo file listing","Pin a revision you have inspected"],"tags":["huggingface","weights","subfolder"],"backgroundTag":"file-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}