Feat: Add support for VieNeu-TTS v3 Turbo (48 kHz) Model Family#80
Conversation
…h Python reference
…e for offline voice cloning
…put to match Python exactly
…ting structured position encoding
… acoustic decoder stack
|
Conflict resolved with commit 91dc86d from upstream |
|
@phuocnguyen90 Thanks for expanding audio.cpp’s model support! I recently refactored the project layout to make long-term maintenance easier. Could you move this model under A few specific comments:
A better shape would be using
Also please provide the results based on #54 (comment) |
|
@phuocnguyen90 The compile failures are my issue. I will fix it |
…tion, correct error prefixes, clean up obsolete task placeholders, and register safetensors download support
|
@phuocnguyen90 Pushed b4bdec0. Please use a community-model-scoped constant cache for now. I’ll refactor it into a framework-level feature later. |
…g for longform speech synthesis
…sion and loader CLI
|
Hi @0xShug0, Thank you for the detailed feedback and for setting up the community model structure! We have updated the PR to address all of your comments and synced with upstream Here is a summary of the updates applied: 1. Community Model Relocation & Docs
2. Model-Agnostic CLI & Request Options
3. Error Messages & Unused Task Cleanup
4. Model Manager Integration
5. Community Model Validation Results (With respect to issue #54)
All changes have been tested locally and pushed to the PR branch. Thanks again for your guidance! |
|
@phuocnguyen90 Thank you! PR merged. |
|
Updated main README to include your model. Please help spread the word at https://github.com/pnnbao97/VieNeu-TTS or reddit. |
…ug0#80) * feat: implement native C++ VieNeu-TTS v3 Turbo runner and packaging support * feat: align VieNeu-TTS prompt embedding layout and speaker anchor with Python reference * feat: support loading pre-computed speaker embedding from sidecar file for offline voice cloning * fix: align C++ speaker embedding and acoustic decoder conditioning input to match Python exactly * Fix VieNeu-TTS v3 Turbo acoustic embedding mapping and text logits early stopping * Revert file mode permission change on build_linux.sh to match upstream main * Update VieNeu-TTS talker to use QwenDecoderPositionEncoding::None for acoustic decoder stack * Move vietneu_tts under community_models to match project contributions policy * Address review: revert CLI changes, support speaker_embedding_file option, correct error prefixes, clean up obsolete task placeholders, and register safetensors download support * Update documentation with request-option formatting * Use community-scoped constant tensor cache from upstream * Update vietneu_tts_v3_turbo model manager package to point to working GGUF repository * Set kDefaultTextChunkSize to 200 to enable automatic sentence chunking for longform speech synthesis * Expose text_chunk_size and text_chunk_mode in vietneu_tts runtime session and loader CLI
Project Alignment & Vision
This contribution adds native C++ model support for VieNeu-TTS v3 Turbo (48 kHz), enabling highly optimized, torch-free CPU execution with GGUF quantization.
Community Value & Motivation
audio.cppprovides a highly optimized compiled C++ pathway that executes 4x faster than real-time (RTF0.24) with a lightweight disk and memory footprint.In alignment with
audio.cpp's contribution guidelines:vietneu_ttsdirectory and namespace. We did not modify or branch inside the existingqwen3_ttscodebase, ensuring zero regression risk to existing models.model_specs/vietneu_tts.jsonto compose cleanly with the packaging and metadata surfaces.📊 Validation & Parity Report
1. Build and Run Commands
Compile Target:
Execution Run:
2. Parity Test Results (Python vs C++)
In deterministic argmax mode (temperature$10^{-8}$ ), the generated token code sequences and predicted decoder logits match the Python reference implementation exactly.
Predicted Logits (Step 1, first codebook):
741:8.3750 947:6.9375 286:6.6250 586:6.4062 546:6.2500741:8.3750 947:6.9375 286:6.6250 586:6.4062 546:6.2500Generated Tokens Parity (First 10 steps):
[741, 546, 894, 753, 50, 935, 607, 686, 141, 55][741, 546, 894, 753, 50, 935, 607, 686, 141, 55]Output Audio Length Parity:
Text logits projected from slot 0 are checked against EOS token
6, resulting in a clean generation finish at 3.68s (exactly matching Python speech length, with no silent padding).3. Backend & Performance Notes
mmaplazy file loading (compared to ONNX's 6.4s / PyTorch's 9.3s).4. C++ Test Execution Results
To ensure zero framework regression, we compiled and executed the core unit test suite on both CPU and CUDA:
sentencepiece_real_model_test: Passed (ok)audio_dsp_test: Passed (ok)scaled_dot_product_attention_test: Passed (ok on CUDA)Executed on an NVIDIA GeForce RTX 3060; compared standard explicit attention with flash attention and verified exact mathematical parity (
cosine=1).audiocpp_cli,audiocpp_server,audiocpp_gguf,model_perf) compiled successfully, demonstrating that theif (config_.rope_type >= 0)addition does not break framework builds.The C++ core execution is verified to be regression-free and stable on both CPU and CUDA backends.
🔗 Replication & Testing References
🛠️ Implementation Details
117for VieNeu-TTS.6to terminate autoregression early.src/models/vietneu_tts/talker.cppsrc/models/vietneu_tts/session.cppsrc/models/vietneu_tts/loader.cppsrc/models/vietneu_tts/assets.cppmodel_specs/vietneu_tts.json🛡️ Shared Framework Safety Note
To integrate the new model family while maintaining strict backward compatibility and zero regression risk for existing models:
src/framework/modules/attention/qwen_decoder.cpp:We added a safe, general check
if (config_.rope_type >= 0)surrounding the query/key RoPE builds. This allows downstream layers that do not utilize rotary position embeddings (like the stack blocks in VieNeu-TTS's CodePredictor) to bypass the operator cleanly by settingrope_type = -1(GGML's standardGGML_ROPE_TYPE_NONE).All existing Qwen3-TTS models are completely unaffected, as they specify positive
rope_typeconfigurations and will continue executing RoPE as normal.app/cli/request.cpp:Added CLI parsing arguments for
--subtalker-temperature,--subtalker-do-sample, and automatic loading of speaker embeddings sidecar files (<ref_audio>.emb.txt) when--voice-refis specified.This is fully backward-compatible for existing model run tasks, and has been verified to build and run correctly under the local validation suite.