{"record":{"id":"ddb58d9505d51905","repo":"OpenBMB/VoxCPM","slug":"you-must-provide-hf-model-id","errorCode":null,"errorMessage":"You must provide hf_model_id","messagePattern":"You must provide hf_model_id","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/voxcpm/core.py","lineNumber":153,"sourceCode":"                provided without lora_config, a default config will be created with\n                enable_lm=True and enable_dit=True.\n            lora_weights_path: Path to pre-trained LoRA weights (.pth file or directory\n                containing lora_weights.ckpt). If provided, LoRA weights will be loaded\n                after model initialization.\n        Kwargs:\n            Additional keyword arguments passed to the ``VoxCPM`` constructor.\n\n        Returns:\n            VoxCPM: Initialized instance whose ``voxcpm_model_path`` points to\n            the downloaded snapshot directory.\n\n        Raises:\n            ValueError: If neither a valid ``hf_model_id`` nor a resolvable\n                ``hf_model_id`` is provided.\n        \"\"\"\n        repo_id = hf_model_id\n        if not repo_id:\n            raise ValueError(\"You must provide hf_model_id\")\n\n        # Load from local path if provided\n        if os.path.isdir(repo_id):\n            local_path = repo_id\n        else:\n            # Otherwise, try from_pretrained (Hub); exit on failure\n            local_path = snapshot_download(\n                repo_id=repo_id,\n                cache_dir=cache_dir,\n                local_files_only=local_files_only,\n            )\n\n        return cls(\n            voxcpm_model_path=local_path,\n            zipenhancer_model_path=zipenhancer_model_id if load_denoiser else None,\n            enable_denoiser=load_denoiser,\n            optimize=optimize,\n            device=device,","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/OpenBMB/VoxCPM/blob/f5a1c6a6b901bc732e20f0d59a369f6829ad717a/src/voxcpm/core.py#L135-L171","documentation":"VoxCPM.from_pretrained requires a Hugging Face repo id (or local dir path); an empty/None hf_model_id with no resolvable default raises immediately.","triggerScenarios":"Calling from_pretrained() with hf_model_id=None or '' when no default model is configured.","commonSituations":"Omitting the model argument expecting a default, passing an empty string from a config/env var that was never set, or variable-name mixups (e.g. passing model_id keyword the function doesn't accept).","solutions":["Pass an explicit hf_model_id, e.g. from_pretrained('openbmb/VoxCPM-0.5B')","If it should come from config/env, verify that value is actually populated before calling","For local checkpoints pass the directory path as hf_model_id"],"exampleFix":"# before\nmodel = VoxCPM.from_pretrained(hf_model_id=None)\n# after\nmodel = VoxCPM.from_pretrained(hf_model_id=\"openbmb/VoxCPM-0.5B\")","handlingStrategy":"validation","validationCode":"if not hf_model_id:\n    hf_model_id = os.environ.get(\"VOXCPM_MODEL\", \"openbmb/VoxCPM-0.5B\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit repo id or configure a default","Fail fast on empty config values at app startup"],"tags":["model-loading","missing-argument","huggingface"],"backgroundTag":"missing-required-parameter","analyzedSha":"f5a1c6a6b901bc732e20f0d59a369f6829ad717a","analyzedAt":"2026-08-27T05:54:30.617Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}