OpenBMB/VoxCPM · error · ValueError
Unsupported architecture: {arch}
Error message
Unsupported architecture: {arch} What it means
VoxCPM.__init__ dispatches on an architecture string and only recognizes specific values (v1 VoxCPMModel / v2 VoxCPM2Model branches). Any other arch string reaches the else branch and raises ValueError.
Source
Thrown at src/voxcpm/core.py:83
if arch == "voxcpm2":
self.tts_model = VoxCPM2Model.from_local(
voxcpm_model_path,
optimize=optimize,
device=device,
lora_config=lora_config,
)
print("Loaded VoxCPM2Model", file=sys.stderr)
elif arch == "voxcpm":
self.tts_model = VoxCPMModel.from_local(
voxcpm_model_path,
optimize=optimize,
device=device,
lora_config=lora_config,
)
print("Loaded VoxCPMModel", file=sys.stderr)
else:
raise ValueError(f"Unsupported architecture: {arch}")
# Load LoRA weights if path is provided
if lora_weights_path is not None:
print(f"Loading LoRA weights from: {lora_weights_path}", file=sys.stderr)
loaded_keys, skipped_keys = self.tts_model.load_lora_weights(lora_weights_path)
print(f"Loaded {len(loaded_keys)} LoRA parameters, skipped {len(skipped_keys)}", file=sys.stderr)
self.text_normalizer = None
self.denoiser = None
if enable_denoiser and zipenhancer_model_path is not None:
from .zipenhancer import ZipEnhancer
self.denoiser = ZipEnhancer(zipenhancer_model_path)
else:
self.denoiser = None
if optimize:
print("Warm up VoxCPMModel...", file=sys.stderr)
self.tts_model.generate(View on GitHub (pinned to f5a1c6a6b9)
Solutions
- Check the accepted arch values in core.py above the raise and use one of them
- Upgrade voxcpm if the arch is from a newer release
- Fix case/typo in the arch string
Example fix
# before model = VoxCPM(arch="V2", ...) # after model = VoxCPM(arch="v2", ...)
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED_ARCH = {"v1", "v2"} # verify against core.py
if arch not in SUPPORTED_ARCH:
raise ValueError(f"unsupported arch {arch}; pick from {SUPPORTED_ARCH}") Type guard
def is_supported_arch(a: str) -> bool:
return a in {"v1", "v2"} Try / catch
try:
VoxCPM(arch=arch, ...)
except ValueError as e:
if 'Unsupported architecture' in str(e): raise ConfigError(arch) from e
raise Prevention
- Pin the voxcpm version your configs were written for
- Centralize arch constants instead of hardcoding strings
When it happens
Trigger: Instantiating the wrapper with arch='v3', a typo like 'V2' or 'v1x', or an arch value introduced in a newer version than the installed package supports.
Common situations: Upgrading config files or checkpoints from a newer VoxCPM release, case mismatches, or hand-editing model configs.
Related errors
- Tokenization failed: {str(e)}
- Unsupported dtype: {dtype}
- Unsupported device '{device}'. Supported values are 'auto',
AI-assisted analysis of OpenBMB/VoxCPM@f5a1c6a6b9 (2026-08-27).
Data as JSON: /api/errors/664061227f097ad6.
Report an issue: GitHub.