{"record":{"id":"773fb3c46cc13813","repo":"unslothai/unsloth","slug":"local-checkpoint-repo-id-is-not-a-safetensors","errorCode":null,"errorMessage":"Local checkpoint '{repo_id}' is not a .safetensors file; a 'single_file' load needs a .safetensors checkpoint.","messagePattern":"Local checkpoint '(.+?)' is not a \\.safetensors file; a 'single_file' load needs a \\.safetensors checkpoint\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/video.py","lineNumber":1239,"sourceCode":"            path_shaped = (\n                repo_id.startswith((\"/\", \"\\\\\", \"~\", \".\")) or \"\\\\\" in repo_id or root.is_absolute()\n            )\n            if root.is_dir():\n                from .diffusion_families import resolve_local_gguf_child\n                try:\n                    resolve_local_gguf_child(root, gguf_filename or \"\")\n                except Exception as exc:  # noqa: BLE001 -- surface as client input error\n                    raise ValueError(str(exc)) from exc\n            elif root.is_file():\n                # The loader hands a local FILE straight through (ignoring gguf_filename), so the file's own suffix must match the kind.\n                suffix = root.suffix.lower()\n                if kind == \"gguf\" and suffix != \".gguf\":\n                    raise ValueError(\n                        f\"Local checkpoint '{repo_id}' is not a .gguf file; a 'gguf' load \"\n                        f\"needs a .gguf checkpoint.\"\n                    )\n                if kind == \"single_file\" and suffix != \".safetensors\":\n                    raise ValueError(\n                        f\"Local checkpoint '{repo_id}' is not a .safetensors file; a \"\n                        f\"'single_file' load needs a .safetensors checkpoint.\"\n                    )\n            elif path_shaped:\n                raise ValueError(f\"Local model path '{repo_id}' does not exist.\")\n        # A local pipeline pick must be a diffusers directory (model_index.json), else it would only fail after eviction.\n        if kind == \"pipeline\":\n            root = Path(repo_id).expanduser()\n            # Gate on .exists() (not .is_dir()) so a local FILE picked as a pipeline is rejected too.\n            indexes = (\n                (\"model_index.json\", \"modular_model_index.json\")\n                if fam.modular_workflow\n                else (\"model_index.json\",)\n            )\n            if root.exists() and not (\n                root.is_dir() and any((root / name).is_file() for name in indexes)\n            ):\n                raise ValueError(","sourceCodeStart":1221,"sourceCodeEnd":1257,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/video.py#L1221-L1257","documentation":"Mirror of [451] for single_file loads of a local FILE: the file's suffix must be .safetensors because the loader passes local files straight through and the single_file path only deserializes safetensors.","triggerScenarios":"load(repo_id='/models/denoiser.ckpt', model_kind='single_file') — repo_id is an existing file whose suffix is not .safetensors (e.g. .ckpt, .pt, .gguf, .bin).","commonSituations":"Legacy .ckpt files; passing a GGUF file path while kind stayed 'single_file'; symlinks or extensionless temp downloads.","solutions":["Convert the file to .safetensors and retry.","If it is a .gguf file, switch model_kind to 'gguf'.","If it is a whole pipeline directory you meant to load, pass the directory with model_kind='pipeline' instead of a file."],"exampleFix":"# before\nload(repo_id='/models/wan25.ckpt', model_kind='single_file')\n\n# after (convert once)\nload(repo_id='/models/wan25.safetensors', model_kind='single_file')","handlingStrategy":"validation","validationCode":"from pathlib import Path\nroot = Path(repo_id).expanduser()\nif root.is_file() and model_kind == 'single_file' and root.suffix.lower() != '.safetensors':\n    raise ValueError('single_file local load needs a .safetensors file')  # client-side","typeGuard":"def local_single_file_ok(repo_id: str, kind: str) -> bool:\n    root = Path(repo_id).expanduser()\n    return not root.is_file() or not (kind == 'single_file' and root.suffix.lower() != '.safetensors')","tryCatchPattern":null,"preventionTips":["Keep local model stores in .safetensors form only.","Validate suffix against model_kind before every load call."],"tags":["video","local-path","safetensors","single-file","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}