microsoft/VibeVoice · critical · RuntimeError

Voices directory not found: {voices_dir}

Error message

Voices directory not found: {voices_dir}

What it means

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.

Source

Thrown at demo/web/app.py:131

        self.model.eval()

        self.model.model.noise_scheduler = self.model.model.noise_scheduler.from_config(
            self.model.model.noise_scheduler.config,
            algorithm_type="sde-dpmsolver++",
            beta_schedule="squaredcos_cap_v2",
        )
        self.model.set_ddpm_inference_steps(num_steps=self.inference_steps)

        self.voice_presets = self._load_voice_presets()
        preset_name = os.environ.get("VOICE_PRESET")
        self.default_voice_key = self._determine_voice_key(preset_name)
        self._ensure_voice_cached(self.default_voice_key)

    def _load_voice_presets(self) -> Dict[str, Path]:
        voices_dir = BASE.parent / "voices" / "streaming_model"
        if not voices_dir.exists():
            raise RuntimeError(f"Voices directory not found: {voices_dir}")

        presets: Dict[str, Path] = {}
        for pt_path in voices_dir.rglob("*.pt"):
            presets[pt_path.stem] = pt_path

        if not presets:
            raise RuntimeError(f"No voice preset (.pt) files found in {voices_dir}")

        print(f"[startup] Found {len(presets)} voice presets")
        return dict(sorted(presets.items()))

    def _determine_voice_key(self, name: Optional[str]) -> str:
        if name and name in self.voice_presets:
            return name

        default_key = "en-Carter_man"
        if default_key in self.voice_presets:
            return default_key

View on GitHub (pinned to 94da20d98b)

Solutions

  1. Run demo/download_experimental_voices.sh to fetch the preset .pt files into demo/voices/streaming_model.
  2. Verify demo/voices/streaming_model exists and contains *.pt files (e.g. en-Carter_man.pt) before starting the app.
  3. If deploying, copy the voices/streaming_model directory next to the web app so BASE.parent/voices/streaming_model resolves.
  4. Check for a nested-directory mistake: the script must produce demo/voices/streaming_model, not demo/voices alone.

Example fix

# before
uvicorn web.app:app  # RuntimeError: Voices directory not found

# after
bash demo/download_experimental_voices.sh
ls demo/voices/streaming_model/*.pt  # en-Carter_man.pt ...
uvicorn web.app:app
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
voices = Path(__file__).resolve().parent / "voices" / "streaming_model"
if not voices.is_dir():
    raise SystemExit(f"Missing {voices}. Run demo/download_experimental_voices.sh first.")
# then start the app

Prevention

When it happens

Trigger: 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/.

Common situations: 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.

Related errors


AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15). Data as JSON: /api/errors/980b7a0d649761b9. Report an issue: GitHub.