Files
vllm-omni/vllm_omni/utils/custom_voice_io.py
T
2026-05-31 17:51:24 +00:00

13 lines
319 B
Python

"""Shared helpers for custom voice profile tools."""
from __future__ import annotations
import re
def safe_voice_stem(name: str) -> str:
stem = re.sub(r"[^a-zA-Z0-9_.-]+", "_", name.strip())
if not stem or stem in (".", ".."):
raise ValueError(f"Invalid voice name: {name!r}")
return stem[:200]