{"record":{"id":"750b4207e2f31469","repo":"sgl-project/sglang","slug":"no-model-files-found-in-model-path","errorCode":null,"errorMessage":"No model files found in {model_path}","messagePattern":"No model files found in (.+?)","errorType":"exception","errorClass":"IntegrityError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/model_file_verifier.py","lineNumber":111,"sourceCode":"            errors.append(\n                f\"{filename}: mismatch (expected={exp.sha256[:16]}... size={exp.size}, actual={act.sha256[:16]}... size={act.size})\"\n            )\n\n    if errors:\n        raise IntegrityError(\"Integrity check failed: \" + \"; \".join(errors))\n\n\n# ======== Generate ========\n\n\ndef generate_checksums(\n    *, source: str, output_path: str, max_workers: int = 4\n) -> Manifest:\n    if Path(source).is_dir():\n        model_path = Path(source).resolve()\n        files = _discover_files(model_path)\n        if not files:\n            raise IntegrityError(f\"No model files found in {model_path}\")\n        manifest = _compute_manifest_from_folder(\n            model_path=model_path, filenames=files, max_workers=max_workers\n        )\n    else:\n        manifest = Manifest(files=_load_file_infos_from_hf(repo_id=source))\n\n    Path(output_path).write_text(\n        json.dumps(manifest.to_dict(), indent=2, sort_keys=True)\n    )\n\n    print(\n        f\"[ModelFileVerifier] Generated checksums for {len(manifest.files)} files -> {output_path}\"\n    )\n    return manifest\n\n\ndef _discover_files(model_path: Path) -> List[str]:\n    return sorted(","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/model_file_verifier.py#L93-L129","documentation":"generate_checksums walks the given local directory via _discover_files looking for model files (weights, configs, tokenizer files). If nothing matches, it raises IntegrityError — the directory exists but contains no recognizable model files.","triggerScenarios":"Calling generate_checksums(source=<dir>) where the directory is empty, contains only non-model files, or the files are nested deeper than the discovery depth / excluded by pattern.","commonSituations":"Pointing --source at a wrong or empty directory (e.g., the cache root instead of the snapshot dir), a still-ongoing download directory, or a directory whose files don't match the discovery allowlist.","solutions":["Verify the path points at the actual model snapshot (e.g., ~/.cache/huggingface/hub/models--org--name/snapshots/<rev>) and contains *.safetensors/config.json.","Check _discover_files' file patterns/depth to see which filenames qualify and rename/relocate files accordingly.","If generating from an HF repo id instead of a local path, pass the repo id as source (non-directory branch)."],"exampleFix":"# before\ngenerate_checksums(source=\"~/.cache/huggingface/hub/models--meta-llama--Llama-3-8B\", output_path=\"m.json\")\n\n# after\nimport glob\ngenerate_checksums(source=glob.glob(\"~/.cache/huggingface/hub/models--meta-llama--Llama-3-8B/snapshots/*\")[0], output_path=\"m.json\")","handlingStrategy":"validation","validationCode":"p = Path(source)\nif not p.is_dir() or not any(p.rglob(\"*.safetensors\")) and not (p / \"config.json\").exists():\n    raise SystemExit(f\"{source} does not look like a model dir\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check for config.json/safetensors before calling generate_checksums.","Prefer passing the resolved HF snapshot directory."],"tags":["model-files","checksum","path"],"backgroundTag":"no-files-found-in-directory","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}