Skip to content

Training WebUI: auto-download models from HuggingFace Hub #375

Description

@bluecrystaladmin

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions