The WebUI should auto-download models from HuggingFace Hub when a repo ID is provided, and default to the correct 16 kHz sample rate.
The training WebUI requires a local model directory path. If a user specifies a HuggingFace repo ID (e.g., openbmb/VoxCPM2), the training script crashes when trying to read config.json from a nonexistent local path. Additionally, the default sample_rate widget value is 44100 Hz but VoxCPM2's AudioVAE expects 16000 Hz — the auto-detection function (detect_sample_rate) only works when the model is already downloaded locally.
Fix: Add _resolve_pretrained_path() that calls huggingface_hub.snapshot_download() when the path looks like a Hub ID. Correct the sample rate default to 16000 Hz. This enables zero-setup first-run: specify a Hub ID and the WebUI downloads + trains automatically.
The WebUI should auto-download models from HuggingFace Hub when a repo ID is provided, and default to the correct 16 kHz sample rate.
The training WebUI requires a local model directory path. If a user specifies a HuggingFace repo ID (e.g., openbmb/VoxCPM2), the training script crashes when trying to read config.json from a nonexistent local path. Additionally, the default sample_rate widget value is 44100 Hz but VoxCPM2's AudioVAE expects 16000 Hz — the auto-detection function (detect_sample_rate) only works when the model is already downloaded locally.
Fix: Add _resolve_pretrained_path() that calls huggingface_hub.snapshot_download() when the path looks like a Hub ID. Correct the sample rate default to 16000 Hz. This enables zero-setup first-run: specify a Hub ID and the WebUI downloads + trains automatically.