microsoft/VibeVoice · error · RuntimeError
Voice preset {key!r} not found
Error message
Voice preset {key!r} not found What it means
Raised by _ensure_voice_cached when asked to cache a voice preset key that is not in self.voice_presets. Preset keys are the .pt filename stems discovered at startup (e.g. 'en-Carter_man'), so any key from another naming scheme (path, display name, uppercase) will miss. Note the main request path (_get_voice_resources) already falls back to default_voice_key, so hitting this usually means an internal call passed a raw/unvalidated key.
Source
Thrown at demo/web/app.py:157
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
first_key = next(iter(self.voice_presets))
print(f"[startup] Using fallback voice preset: {first_key}")
return first_key
def _ensure_voice_cached(self, key: str) -> Tuple[object, Path, str]:
if key not in self.voice_presets:
raise RuntimeError(f"Voice preset {key!r} not found")
if key not in self._voice_cache:
preset_path = self.voice_presets[key]
print(f"[startup] Loading voice preset {key} from {preset_path}")
print(f"[startup] Loading prefilled prompt from {preset_path}")
with torch.serialization.safe_globals([BaseModelOutputWithPast, DynamicCache]):
prefilled_outputs = torch.load(
preset_path,
map_location=self._torch_device,
weights_only=True,
)
self._voice_cache[key] = prefilled_outputs
return self._voice_cache[key]
def _get_voice_resources(self, requested_key: Optional[str]) -> Tuple[str, object, Path, str]:
key = requested_key if requested_key and requested_key in self.voice_presets else self.default_voice_key
if key is None:View on GitHub (pinned to 94da20d98b)
Solutions
- Use the exact preset stem (filename without .pt), e.g. 'en-Carter_man', matching a file in demo/voices/streaming_model.
- Print sorted(service.voice_presets) and pick the key from that list.
- Set VOICE_PRESET to a valid stem or unset it to fall back to en-Carter_man / first key.
- If presets changed on disk, restart the service so presets are re-discovered.
Example fix
# before
service._ensure_voice_cached("en-Carter_man.pt")
# after
key = "en-Carter_man" # exact stem from service.voice_presets
service._ensure_voice_cached(key) Defensive patterns
Strategy: validation
Validate before calling
def valid_voice_key(service, key: str) -> bool:
return key in service.voice_presets # keys are .pt stems
if not valid_voice_key(service, requested):
requested = service.default_voice_key Type guard
def is_known_voice(service, key: object) -> bool:
return isinstance(key, str) and key in service.voice_presets Try / catch
try:
out = service._ensure_voice_cached(key)
except RuntimeError:
key = next(iter(service.voice_presets))
out = service._ensure_voice_cached(key) Prevention
- Treat VOICE_PRESET values as untrusted; validate against service.voice_presets
- Use stems without the .pt extension
- Restart the service after changing preset files on disk
When it happens
Trigger: Calling service._ensure_voice_cached('en-Carter_man.pt') (with extension), 'Carter', or a VOICE_PRESET env value that was never validated against the discovered keys; calling load-dependent methods before load() populated voice_presets.
Common situations: VOICE_PRESET env var set to a name that does not match any .pt stem in demo/voices/streaming_model; preset files renamed after startup; passing a Path instead of the stem string.
Related errors
- Voices directory not found: {voices_dir}
- No voice preset (.pt) files found in {voices_dir}
- Multiple voice presets match the speaker name '{speaker_name
- StreamingTTSService not initialized
- MODEL_PATH not set in environment
AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15).
Data as JSON: /api/errors/85550e4078588a41.
Report an issue: GitHub.