Skip to content

[codex] Add full Windows CUDA installer - #349

Open
AdamRastrand1234 wants to merge 11 commits into
OpenBMB:mainfrom
AdamRastrand1234:codex/add-windows-installer
Open

[codex] Add full Windows CUDA installer#349
AdamRastrand1234 wants to merge 11 commits into
OpenBMB:mainfrom
AdamRastrand1234:codex/add-windows-installer

Conversation

@AdamRastrand1234

@AdamRastrand1234 AdamRastrand1234 commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • Add a full Windows install.bat that creates/reuses .venv, installs uv, selects CUDA PyTorch/torchaudio automatically for NVIDIA GPUs, falls back to CPU wheels otherwise, installs .[timestamps,dev], creates runtime directories, downloads required models, and runs smoke checks.
  • Download/use the default VoxCPM2 model under models\openbmb__VoxCPM2, plus local ModelScope denoiser and ASR model directories used by the web UI to avoid runtime network fetches where possible.
  • Pre-download NVIDIA Parakeet ASR (nvidia/parakeet-tdt-0.6b-v3) to models\nvidia__parakeet-tdt-0.6b-v3 by default in install.bat. app.py --asr-backend auto now uses that local Parakeet model on CUDA with local_files_only=True, and falls back to SenseVoice when Parakeet is not installed or CUDA is not selected.
  • Preload the selected ASR backend and VoxCPM TTS model before launching Gradio, so the first Generate click no longer pays the big model-load cost. --no-preload keeps the old lazy-load behavior if needed.
  • Show explicit web UI status/progress instead of only Gradio Processing: ASR backend/device/language line, transcribing progress messages, voice-prompt preparation, synthesising speech percentages from the actual model inference loop, and finalising/complete messages.
  • Fix the Gradio Ultimate Cloning + auto-transcribe flow: normalize Gradio audio file payloads, convert ASR input to 16 kHz mono WAV, re-run ASR when reference audio changes, auto-fill the transcript before TTS starts on Generate, preserve existing transcript text when toggling, and show clear ASR failure placeholders instead of leaving Recognizing... forever.
  • Lazy-load ZipEnhancer only when denoising is requested, so app/model startup does not eagerly initialize the denoiser unless --preload-denoiser is used.
  • Make the runtime dtype script safe for pytest collection and add focused app/denoiser coverage.

Root Cause

  • The UI depended on the checkbox ASR event having completed before Generate. If the uploaded audio state was late, the transcript was still blank, or ASR failed, the textbox could remain at the Recognizing reference audio... placeholder.
  • The first Generate call was also the first time TTS/ASR models were loaded, which made the UI look stuck on a generic Gradio processing state.
  • Gradio API/file payloads can arrive as file-data objects rather than plain strings, so ASR/TTS needed path normalization.
  • Uploaded audio can arrive in formats/sample rates that are less reliable for ASR. The app now prepares a 16 kHz mono WAV for ASR before calling the selected ASR backend.
  • The installer only checked nvidia-smi, which misses some Windows NVIDIA setups where the adapter is visible but nvidia-smi is not on PATH.

Validation

  • .\.venv\Scripts\python.exe -m py_compile app.py src\voxcpm\core.py src\voxcpm\model\voxcpm.py src\voxcpm\model\voxcpm2.py
  • .\.venv\Scripts\python.exe -m black --check app.py tests\test_app.py src\voxcpm\core.py src\voxcpm\model\voxcpm.py src\voxcpm\model\voxcpm2.py
  • .\.venv\Scripts\python.exe -m pytest -> 71 passed, 2 warnings
  • cmd /c install.bat --cuda --dry-run --no-smoke-checks -> selected Torch: cuda, listed the Parakeet pre-download step, and emitted --device cuda --asr-backend auto start commands.
  • cmd /c install.bat --cpu --dry-run --no-smoke-checks -> selected Torch: cpu, listed the Parakeet pre-download step, and emitted --device cpu --asr-backend auto start commands.
  • Downloaded nvidia/parakeet-tdt-0.6b-v3 to models\nvidia__parakeet-tdt-0.6b-v3, which is git-ignored under models/.
  • Started app.py with HF_HUB_OFFLINE=1, --device cuda, and --asr-backend auto; verified TTS warmup and Parakeet weights loaded before the Gradio URL was printed.
  • Verified in the browser that the web UI shows ASR: NVIDIA Parakeet TDT 0.6B v3 | language: auto-detect | device: cuda.
  • Verified in the browser that Generate shows live progress such as Synthesising speech, 36% instead of only generic Processing.
  • Verified /_run_asr_if_needed on examples/reference_speaker.wav fills the transcript through the running Gradio server.
  • Verified /generate with Ultimate Cloning enabled, reference audio provided, and an empty transcript auto-transcribes with Parakeet and returns generated audio plus the filled transcript.
  • Verified direct CUDA generation: torch.cuda.is_available() == True, GPU NVIDIA GeForce RTX 4060 Laptop GPU, parakeet_device cuda:0, tts_device cuda, generated sr 48000, wav_samples 307200, and CUDA memory was allocated/reserved during generation.
  • Earlier browser/API checks verified /generate with Ultimate Cloning but no audio fails fast with Upload reference audio before using Ultimate Cloning Mode.

@AdamRastrand1234
AdamRastrand1234 force-pushed the codex/add-windows-installer branch from 7a69f13 to 063dd27 Compare June 30, 2026 20:58
@AdamRastrand1234 AdamRastrand1234 changed the title [codex] Add Windows installer [codex] Add full Windows CUDA installer Jun 30, 2026
@AdamRastrand1234
AdamRastrand1234 marked this pull request as ready for review June 30, 2026 20:58
@AdamRastrand1234
AdamRastrand1234 force-pushed the codex/add-windows-installer branch from 063dd27 to 72fe380 Compare June 30, 2026 21:01
@LauraGPT

LauraGPT commented Jul 7, 2026

Copy link
Copy Markdown

I did a light pass over this Windows CUDA installer / ASR backend PR at head 9f34141cc81e, mainly from the SenseVoice fallback and installability angle.

What I checked in /tmp/voxcpm-pr349:

  • pyproject.toml parses and the new transformers>=5.12.0 lower bound is satisfiable on PyPI today (5.12.0 exists; latest returned by PyPI was 5.13.0).
  • git diff --check
  • python3 -m py_compile app.py src/voxcpm/core.py src/voxcpm/model/voxcpm.py src/voxcpm/model/voxcpm2.py tests/test_app.py tests/test_core_denoiser.py
  • python3 -m pytest tests/test_core_denoiser.py -q -> 2 passed

I could not run tests/test_app.py in this bare ops environment because it imports the Gradio UI stack (ModuleNotFoundError: No module named 'gradio') before reaching the unit tests; I did not install the full UI/model dependency set just for this pass.

From the code review side, the SenseVoice fallback path looks intentionally covered by the new tests: backend normalization, tag stripping, local Parakeet-vs-SenseVoice fallback selection, ASR model load locking, preload ordering, and reference-audio path normalization all have targeted test cases in tests/test_app.py. A full CI run with the declared project dependencies is still the right merge gate.

@LauraGPT

LauraGPT commented Jul 7, 2026

Copy link
Copy Markdown

I reproduced the current merge conflict against OpenBMB/VoxCPM@07c937b.

The conflict is narrow:

CONFLICT (content): Merge conflict in app.py

The only conflict marker is in the final run_demo(...) call in app.py. origin/main does not add anything on the other side of that hunk, so the clean resolution is to keep this PR's four argument lines:

        asr_backend=args.asr_backend,
        preload=not args.no_preload,
        preload_denoiser=args.preload_denoiser,
        open_browser=not args.no_browser,

I tested that disposable local resolution with:

python3 -m py_compile app.py src/voxcpm/core.py src/voxcpm/model/voxcpm.py src/voxcpm/model/voxcpm2.py tests/test_app.py tests/test_core_denoiser.py
python3 -m pytest tests/test_core_denoiser.py -q  # 2 passed

The upstream merge also brings in scripts/train_voxcpm_finetune.py and tests/test_torch_load_safety.py automatically; I did not see additional conflicts beyond app.py.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants