{"record":{"id":"980b7a0d649761b9","repo":"microsoft/VibeVoice","slug":"voices-directory-not-found-voices-dir","errorCode":null,"errorMessage":"Voices directory not found: {voices_dir}","messagePattern":"Voices directory not found: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"demo/web/app.py","lineNumber":131,"sourceCode":"\n        self.model.eval()\n\n        self.model.model.noise_scheduler = self.model.model.noise_scheduler.from_config(\n            self.model.model.noise_scheduler.config,\n            algorithm_type=\"sde-dpmsolver++\",\n            beta_schedule=\"squaredcos_cap_v2\",\n        )\n        self.model.set_ddpm_inference_steps(num_steps=self.inference_steps)\n\n        self.voice_presets = self._load_voice_presets()\n        preset_name = os.environ.get(\"VOICE_PRESET\")\n        self.default_voice_key = self._determine_voice_key(preset_name)\n        self._ensure_voice_cached(self.default_voice_key)\n\n    def _load_voice_presets(self) -> Dict[str, Path]:\n        voices_dir = BASE.parent / \"voices\" / \"streaming_model\"\n        if not voices_dir.exists():\n            raise RuntimeError(f\"Voices directory not found: {voices_dir}\")\n\n        presets: Dict[str, Path] = {}\n        for pt_path in voices_dir.rglob(\"*.pt\"):\n            presets[pt_path.stem] = pt_path\n\n        if not presets:\n            raise RuntimeError(f\"No voice preset (.pt) files found in {voices_dir}\")\n\n        print(f\"[startup] Found {len(presets)} voice presets\")\n        return dict(sorted(presets.items()))\n\n    def _determine_voice_key(self, name: Optional[str]) -> str:\n        if name and name in self.voice_presets:\n            return name\n\n        default_key = \"en-Carter_man\"\n        if default_key in self.voice_presets:\n            return default_key","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/demo/web/app.py#L113-L149","documentation":"Raised by StreamingTTSService._load_voice_presets during service load: it expects the directory <repo>/demo/voices/streaming_model (BASE.parent / 'voices' / 'streaming_model') to exist and contain the streaming voice presets. If the folder is missing, startup aborts with RuntimeError. The preset .pt files are typically fetched by demo/download_experimental_voices.sh and are not part of the git tree.","triggerScenarios":"Starting demo/web/app.py (FastAPI startup event) when demo/voices/streaming_model does not exist — fresh clone without running the voice download script, or running app.py from a different checkout/layout so BASE.parent points somewhere without voices/.","commonSituations":"Fresh clone; download_experimental_voices.sh never run or failed; the web demo deployed by copying only app.py/static files without the voices directory; wrong working directory changing BASE resolution.","solutions":["Run demo/download_experimental_voices.sh to fetch the preset .pt files into demo/voices/streaming_model.","Verify demo/voices/streaming_model exists and contains *.pt files (e.g. en-Carter_man.pt) before starting the app.","If deploying, copy the voices/streaming_model directory next to the web app so BASE.parent/voices/streaming_model resolves.","Check for a nested-directory mistake: the script must produce demo/voices/streaming_model, not demo/voices alone."],"exampleFix":"# before\nuvicorn web.app:app  # RuntimeError: Voices directory not found\n\n# after\nbash demo/download_experimental_voices.sh\nls demo/voices/streaming_model/*.pt  # en-Carter_man.pt ...\nuvicorn web.app:app","handlingStrategy":"validation","validationCode":"from pathlib import Path\nvoices = Path(__file__).resolve().parent / \"voices\" / \"streaming_model\"\nif not voices.is_dir():\n    raise SystemExit(f\"Missing {voices}. Run demo/download_experimental_voices.sh first.\")\n# then start the app","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the voice download script as part of setup/deployment","Add a preflight check for demo/voices/streaming_model before uvicorn starts","Include the voices directory in deployment artifacts"],"tags":["web-demo","startup","missing-directory","voice-preset","environment"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}