Commit History
14 days ago
-
fix(v3turbo): keep CUDA graph captures away from all other GPU work
torch.cuda.graph() captures in "global" mode. If another thread allocates, frees, synchronises or samples on the device while a graph is being recorded, the capture can break; when cudaStreamEndCapture fails, PyTorch never clears the CUDA generator's "capturing" flag, and every later sampling call or graph replay in the process raises "Offset increment outside graph capture encountered unexpectedly" until the process restarts. A user of the VieNeu desktop app's local GPU server (SDK 3.8.3) got this error and synthesis kept failing until a reboot; a capture overlapping other GPU work is the most likely trigger. v3 Turbo captures lazily (a new batch bucket, cache length or sampling setting mid-request) from whichever thread needs the graph, and _fused_lock (2f73298) only serialises the runs of one engine. Still outside any lock: prompt embeddings and speaker anchors, the codec decode after a batch, reference encoding (encode_reference), the single-path engine, the stream scheduler's wor…c7953c7
-
fix: harden Web UI, speech API and GPU streaming
Đoàn Quang HuyWeb UI - Stop running code from repos typed into "Custom Model": trust_remote_code is off unless VIENEU_TRUST_REMOTE_CODE=1 (the official v1/v2/0.3B checkpoints are stock Qwen2/Qwen3 and need none). Custom repos take the LMDeploy path only with that flag set, since older LMDeploy releases trust remote code on their own. - Optional login via VIENEU_WEB_AUTH=user:password; warn when the UI is reachable beyond localhost without one. Speech API (apps/openai_speech.py) - Listen on 127.0.0.1 by default and warn on a public bind without VIENEU_API_KEY; the Docker profiles set HOST=0.0.0.0. - POST /v1/voices refuses (409) built-in voice names and aliases, so a client can no longer replace the default voice for everyone. - Range-check temperature, top_k, top_p, repetition_penalty and max_chars. Validation errors return 400 in OpenAI's error shape; the default handler turned a NaN into a 500. - /health and new requests return 503 once the GPU stream scheduler has died, so th…ff63dc3
-
feat(voices): đổi tên giọng v3 Turbo — Hải Đăng, Thiện Minh, Quốc Tuấn
Minh Quân Pro → Hải Đăng (giọng mặc định), Anh Khôi → Thiện Minh, Mạnh Dũng → Quốc Tuấn. Tên cũ giữ trong `aliases` nên code gọi voice="Minh Quân" / "Minh Quân Pro" / "Anh Khôi" / "Mạnh Dũng" vẫn chạy. v3 Nano giữ nguyên tên (chưa có cơ chế alias). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>b1ffbe9
-
feat(voices): đổi tên Minh Quân → Minh Quân Pro, giữ "Minh Quân" làm alias tương thích
Voices JSON có trường `aliases` theo entry; SDK resolve alias ở get_preset_voice, _resolve_ref (infer/infer_stream/infer_batch), remove_voice; save_voices giữ alias; list_preset_voices không liệt kê alias. API: voice qua alias vẫn hợp lệ, /v1/voices trả `aliases` + `featured`. README dùng tên mới, ghi rõ tên cũ vẫn gọi được. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>32505a0 -
feat(voices): trường `featured` — 10 giọng tuyển chọn có ⭐ và đứng đầu ở list_preset_voices, dropdown Web UI
`featured` 1..N trong voices JSON đánh dấu thứ tự giọng tuyển; SDK gắn nhãn ⭐ và xếp trước, phần còn lại theo thứ tự file; save_voices giữ trường này. uv.lock cập nhật version 3.8.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>ac8ef44 -
feat(voices): đánh dấu 10 giọng tuyển chọn bằng `featured: 1…10` trong voices_v3_turbo.json
Thứ tự JSON đã là thứ tự hiển thị, nhưng bên đọc bằng map (app Vieneu) mất thứ tự đó; một field rõ ràng trên từng giọng để mọi client xếp "Editor's pick" lên đầu như nhau. Loader SDK đọc theo key nên không đổi hành vi. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>f2a3f69 -
feat(voices): 25 preset — thêm Adam bựa, Thiền Tâm Đức; Trúc Ly dùng clip mới; 10 giọng tuyển chọn xếp đầu
README (Anh/Việt) thêm mục giọng dựng sẵn: 10 giọng tuyển chọn (Adam bựa, Trúc Ly, Anh Khôi, Mai Anh, Minh Quân, Thùy Dung, Thiền Tâm Đức, Ngọc Huyền, Quang Sơn, Ngọc Trân) đứng đầu danh sách, rồi các giọng còn lại theo miền. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>abf2944 -
fix(v3turbo): encoder không nối thêm frame đệm 455 nghe được vào clip tham chiếu và nhãn fine-tune (#198)
Tái hiện đúng như báo cáo: clip không tròn 3840 mẫu → PyTorch trả ceil(n) frame với frame cuối codebook-0 = 455; ONNX luôn trả n+1 frame cùng mã đó kể cả clip tròn frame. Mã 455 giải mã ra RMS ~0.03 (đuôi thật ~0.001) — một tiếng ngắn dán vào đuôi mọi ref_codes và nhãn của 100% hàng fine-tune, mô hình học thuộc. - Cả hai encoder: đệm zero cho tròn frame TRƯỚC khi mã hoá rồi ép T = n_padded/3840. Frame cuối thành mã thật của phần đuôi (RMS khớp audio thật); ONNX nay khớp PyTorch. - strip_encoder_pad_frame(): bỏ frame 455 đuôi khi nạp giọng đã lưu (preset, repo, user). - voices_v3_turbo.json: 7/23 preset (gồm Minh Quân mặc định) từng kết bằng 455 → cắt. - prepare_dataset.py: chặn kho mà >50% hàng cùng một mã codebook-0 cuối. - Test: pad/strip helpers; encoder PyTorch (CUDA) và ONNX không còn 455, số frame đúng. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>521e034
-
feat(v3turbo/cuda): infer_stream continuous batching — một CUDA graph phục vụ nhiều luồng
Đường stream cũ đi qua engine đơn (không graph, khoá cả lượt): chunk đầu 280-360 ms, một luồng, RTF 0,85. Nay trên CUDA mọi infer_stream đi qua V3TurboStreamScheduler: - StreamFrame: fused frame trên B slot, row vào/ra giữa chừng (StaticBackbone.load_row, KV cache ring, RoPE theo row), sampling theo tensor từng row. - Một worker thread, một phiên codec MOSS streaming chung, lead-in 2 khung cho row mới. - max_streams (mặc định 16) là kích thước batch; huỷ generator giải phóng slot. Đo RTX 3060: 1 luồng 115 ms, 16 luồng cùng lúc median 185 ms, request mới giữa 15 luồng 134 ms, RTF xấu nhất 0,59; 32 luồng vẫn real-time (0,93) nhưng chunk đầu ~450 ms. Codec là toàn bộ chi phí (~65 ms + 2,5 ms/slot mỗi lời gọi); chế độ use_cuda_graph của codec cho audio sai nên không dùng. GPU rỗi hạ xung (P8) làm request đầu chậm thêm 100-300 ms — giữ ấm trong tiến trình không hiệu quả, để host khoá xung. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1f92494 -
feat(v3turbo/cuda): frame_hook — gọi mỗi khung ở cả hai vòng, để server dừng giữa batch
Server của app dừng "trong một khung" bằng cách bọc `bb.decode_step`; đường CUDA graph không đi qua đó nên nút Dừng chỉ ăn ở batch kế. `engine.frame_hook` được gọi trước mỗi khung (vòng thường lẫn FusedFrame.run(on_frame=...)); raise từ đó là dừng. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>22ddf29 -
perf(v3turbo/cuda): mỗi khung là một CUDA graph — acoustic + sampling + phạt lặp + backbone gộp một lần phát, nhanh 6×
Đo trên RTX 3060 (giọng Quang Sơn): 1 câu 3,5 s: 2,3 → 0,36 s; đoạn 2 chunk (19 s): 8,7 → 1,4 s; 6 chunk (57 s): 10,6 → 2,1 s; 16 chunk (154 s): 16,7 → 2,8 s (RTF 0,018). Seed cố định → kết quả lặp lại y hệt. Vòng lặp cũ mất ~65 ms/khung mà GPU gần như rảnh: rep-penalty làm trên host (B×16 lần `.item()` sync + copy H2D mỗi khung, 22 ms), backbone HF với DynamicCache + `torch.cat` mask mỗi bước (19 ms), ~1000 kernel tí hon phóng lẻ. Batch hầu như không đổi thời gian (2 chunk 8,4 s, 16 chunk 15 s) — nghẽn độ trễ, không phải tính toán. `CudaGraphedFrame` có sẵn nhưng bị tắt khi `repetition_penalty != 1.0` (mặc định 1,2) — tức chưa bao giờ chạy. v3_turbo_serve/fused.py: - GpuRepHistory: lịch sử phạt lặp bằng tensor (đếm + ring buffer), cùng luật với RepetitionHistory, không sync host. - StaticBackbone: bước giải mã Qwen3 trên KV cache cấp sẵn, dùng chính module HF (norm/proj/rotary/MLP), chỉ thay cache + attention. GQA gấp g head query vào trục vị trí thay vì `enable_gqa` (rơi vào …1e4eeb7 -
fix(chunk): cắt mảnh dài theo từ chia đều, từ nối ngưỡng 1/3 trần, không xẻ đôi con số
`_split_long_part` trước đây greedy: đổ đầy sát trần rồi phần dư đứng riêng (304 ký tự -> 251 + 53), và điểm cắt gần trần hay rơi chỗ tệ — từ nối duy nhất ("và", mảnh trái 121) bị luật "mảnh trái >= max_chars // 2" từ chối, rồi cắt cưỡng bức trúng giữa năm 2031: "…đến hai nghìn." | "không trăm ba mươi mốt…". - `_balanced_cut`: biết trước cần k = ceil(len / max_chars) mảnh, mỗi mảnh nhắm len / k và cắt ở điểm hợp lệ gần đích nhất — ưu tiên trước từ nối, không thì ranh giới từ không lọt giữa cặp từ nối và không nằm giữa hai từ đọc số (`_NUMBER_WORDS`). - Ngưỡng nhận từ nối hạ từ 1/2 xuống 1/3 trần. - Luật trần tương đối (đuôi <= slack gộp vào mảnh trước) giữ nguyên. Câu ví dụ giờ thành "…ngày mười sáu tháng năm hai nghìn không trăm hai mươi lăm." | "và ký chương trình … tháng năm." (127 | 186). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>5c8b7ee -
chore(v3turbo): use blake2b for the reference-cache key (Sonar S4790)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>6c37b74 -
perf(v3turbo/onnx): cut CPU load on the voice-cloning path
Cloning ran at ~5 cores avg (RTF 0.64) vs ~3 for preset synthesis on a 6-core CPU. Two causes: - The denoiser, speaker-encoder and codec-encoder sessions were created with default SessionOptions: a pool of every logical core that busy-waits between ops. They now share the engine's tuned options (thread cap, no spinning). - No reference cache: every infer_stream(ref_audio=...) re-ran denoise + x-vector + codec encode (~2.7 s) for the same clip. V3TurboVieNeuTTS now memoises enrolment by clip content (sha1, LRU 32) for encode_reference and _resolve_ref, so repeated requests and document chunks hit the cache. Measured: clone RTF 0.64 -> 0.36, 5.1 -> 3.0 cores avg; first enrol <= 4.4 cores instead of 6-10; cache hits are bit-identical to a recompute. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>d89b2af
-
fix(core_utils): syllable_count đếm thiếu âm tiết của từ tiếng Anh
Đếm thiếu làm max_expected_frames trả trần thấp hơn thực tế, và chunk bị cắt cụt. Đo trên 44 từ tiếng Anh (phoneme lấy từ SEAPipeline(lang="vi"), sea-g2p 0.9.1): 13 từ bị đếm thiếu. create kɹiːˈeɪt đếm 1, thật 2 -> trần 13 frame (1,04 s) director dᵻɹˈɛktɚ đếm 1, thật 3 -> trần 13 frame (1,04 s) computer kəmpjˈuːɾɚ đếm 2, thật 3 radio ɹˈeɪdɪˌoʊ đếm 2, thật 3 audio ˈɔːdɪˌoʊ đếm 2, thật 3 Hai nguyên nhân: 1. _IPA_VOWELS thiếu bốn ký hiệu eSpeak/sea-g2p vẫn sinh ra: ɚ ɝ (nguyên âm r-colored) và ᵻ ᵿ (nguyên âm giảm ở âm tiết không nhấn). Thiếu chúng thì cả một âm tiết biến mất khỏi phép đếm. 2. Nhóm nguyên âm mới chỉ mở sau một PHỤ ÂM. Nhưng trong IPA, dấu nhấn đứng ngay trước âm tiết mà nó nhấn, nên dấu nhấn cũng là ranh giới âm tiết kể cả khi không có phụ âm chen giữa. Bản vá cho ˈ/ˌ mở âm tiết mới KHI token đã có ít nhất một cụm nguyên âm (groups > 0). Điều kiện đó là chỗ giữ an toàn cho tiếng Việt: sea-g2p đặt đúng MỘT dấu …4872ba1 -
Gradio: Voice Cloning as a top-level tab with saveable voices; PyTorch engine clones without torchaudio
- Voice Cloning moves out of the story tab's inner Preset/Cloning switch and sits next to Đọc truyện / Hội thoại / SRT, with its own text box and button. - Save a cloned voice under a name (apps/user_voices.py): it appears in every preset dropdown (story, conversation, SRT) and persists in ~/.vieneu/user_voices_v3_{turbo,nano}.json across restarts; delete from the same tab. Built-in voice names are protected. - inference_v3_turbo: read references with soundfile and resample with soxr (both base deps); torchaudio is only a fallback. The [cuda] extra never installed torchaudio, so cloning on GPU failed with 'No module named torchaudio'. - Version 3.6.4. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>021a0f1
-
v3.6.3: chunk join keeps model audio (no edge trim), longer pauses between chunks
- join_audio_chunks (v3 path) no longer calls trim_and_fade on each chunk. The audio the model generated is kept as is; pause_pad_samples measures the tail silence of the previous chunk + lead silence of the next and only pads zeros for the deficit. V3_GAP_SILENCE is therefore a MINIMUM pause — a longer natural tail is preserved. Streaming already worked this way; v3 Nano keeps its own engine-level trim of the flow-model output. - V3_GAP_SILENCE raised 0.55/0.32/0.14 -> 0.70/0.50/0.30 (para/sentence/minor). Measured on the 23 v3 Turbo presets with the whole sentence in one chunk, the model pauses ~0.30-0.45 s at commas and ~0.50-0.65 s at sentence ends; the old table was about half of that, so force-split sentences sounded crammed. - tests: join test now checks the minimum-pause contract and that no audio is removed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>9675ecc -
Default preset voice: Minh Quân (was Adam) for v3 Turbo and v3 Nano; README examples updated
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>9ffb45c -
babble guard: standalone vocal cues ([cười], [thở dài]) capped at ~1 s like a 1-syllable chunk
Measured 48 generations of standalone cues: natural laugh / sigh / throat-clear last 5-12 frames, while missed-EOS runs jump straight to 19-60 frames (Mai Anh: 3-4 of 8). The phoneme-length cap gave such chunks 26 frames of babble. A cue-only chunk now gets the 13-frame cap and the cap-hit rule (no burst counting — a laugh is many bursts). Word + cue chunks are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>ad7bc40 -
v3turbo: remove dead code left after moving the babble guard into the engines (Sonar S1763)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>61cf9cc -
v3 Turbo: syllable-based frame cap + babble guard in all engines (v3.6.1)
Short chunks (1-3 syllables) occasionally miss the stop token and "add a word" ("Được." -> "Được không?"). Measured on 720 short chunks: every case was a 1-syllable chunk running to the 13-frame cap; GPU batch, GPU single and CPU ONNX were equally affected (~5% of 1-syllable chunks). - core_utils: syllable_count() (vowel nuclei in SEA-G2P phonemes, tone marks and length marks don't split), count_speech_bursts(), babble_suspect(). - max_expected_frames(): the ~1s hard cap is now per SYLLABLE (13 + 5 per extra syllable, up to 4) instead of per word, so one-word multi-syllable English chunks ("notification") are no longer truncated at 13 frames. - Babble guard in the PyTorch, ONNX and batch engines: a chunk <= 2 syllables that hits its cap, or <= 3 syllables with more energy bursts than syllables, is regenerated up to `babble_retries` (default 2) times, keeping the best attempt. Lives at engine level so SDK, Gradio and server paths are all covered; `Vieneu(babble_retries=0)…1d3598b
-
finetune: CI/Sonar fixes — isolate torch tests, confine CLI paths, numpy RNG
- tests/test_finetune_lora.py runs finetune/tests in a fresh interpreter (other test modules stub `torch` in sys.modules at import time). - finetune scripts resolve every CLI path through vieneu_lora.utils.safe_path (must stay under the working directory) — Sonar S2083/S8707. - Dataset/trainer use numpy's Generator instead of `random` (S2245); the SDK no longer logs repo-derived strings (S5145). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>0657ea2 -
v3.6.0: LoRA fine-tuning for v3 Turbo (replaces the v1/v2 finetune toolkit)
finetune/ is rewritten around the v3 Turbo model shipped in the SDK: - prepare_dataset.py: clips + transcripts -> train.parquet (phones, MOSS codes, speaker embedding) on the CPU, torch-free, via the SDK's ONNX codec/speaker encoder. - train_lora.py: PEFT LoRA on the backbone (optionally the acoustic decoder), bf16, cosine schedule, hold-out eval, checkpoints, optional merged export. - merge_lora.py: adapter + base -> model folder in the official repo layout, optional push to the Hub. make_voice.py: pack a clip as a preset voice. - vieneu_lora/: sequence + label builder, teacher-forcing forward + loss, LoRA attach/save/load/merge/export helpers. - Old v1/v2 scripts, configs and notebook removed. `finetune` extra in pyproject. SDK: V3TurboVieNeuTTS also loads voices_v3_turbo.json shipped with a model folder or Hub repo (fine-tuned voices), and the PyTorch engine reads denoiser.onnx from a local model folder. README: new "Fine-tuning (LoRA)" section (en/vi). Co-Authored-By: Cl…5d753d0 -
v3.5.4: voice cloning for v3 Nano
- OnnxV3NanoEngine.prepare_reference: reference clip -> (192-d x-vector, 50x256 style tokens) torch-free, following the Nano export recipe (Kaldi fbank x-vector; codec_encoder latent of the first 5 s, normalised with the training mean/std/scale, grouped x6, cropped to ref_max_frames -> reference_encoder). The cloning graphs (speaker_encoder / codec_encoder / reference_encoder, plus the optional denoiser) are fetched from the Nano HF repo on first use. - V3NanoVieNeuTTS: encode_reference, add_voice, remove_voice, save_voices, ref_audio= and denoise= on infer / infer_stream / infer_batch (batch enrolls the clip once). Same edge-silence pre-clean as v3 Turbo. - Gradio: cloning enabled for the Nano backbone. README/docstrings updated. - Tests: engine reference path + grouping, full TTS cloning paths (fake ORT). Verified against the torch-built presets: style tokens identical, x-vector cosine >= 0.997 (fbank implementation differences only). Co-Authored-By: Claude Fable 5.1 …c5789db -
v3.5.3: add 5 preset voices to v3 Nano (11 total)
Mai Anh, Trúc Ly, Anh Khôi, Minh Quân, Mạnh Dũng — built from the same reference clips as their v3 Turbo counterparts (192-d x-vector + 50x256 style tokens over the first 5 s, per the Nano export recipe). README rosters updated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>4e820c9 -
v3.5.2: re-enroll preset voices Trúc Ly and Mai Anh
Same names and labels; speaker embedding + reference codes replaced with new 6-7 s reference clips (76 and 74 frames). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>dc723bb -
v3.5.1: chunk join with fixed pauses, soft chunk cap, new preset voices
- join_audio_chunks(silence_ps=...): trim+fade each chunk edge, then pad zeros so the real pause equals V3_GAP_SILENCE (para 0.55 / sentence 0.32 / minor 0.14 s). Pauses no longer depend on the voice: presets emitted ~300 ms of silence before EOS while cloned voices emitted almost none, so cloned chunks sounded crammed. v3 Turbo/Nano infer_stream now insert the same pauses between text chunks. - Chunk cap is soft: a remainder shorter than 15 chars (e.g. "phương.") merges into the previous chunk instead of being glued to the next sentence. - Presets: Xuân Vĩnh re-enrolled (Northern), add Anh Khôi (storytelling), Mạnh Dũng, Minh Quân (natural) — 23 voices. - Gradio conversation tab: default inter-turn silence 0.3 s. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>c87b58b
-
Add VieNeu-TTS v3 Nano (preview) for edge devices and weak CPUs
- New `Vieneu(mode="v3nano")` backend: 48M-param flow-matching model, ONNX/CPU, torch-free, 24 kHz, 6 preset voices (no cloning), emotion tags supported. - Gradio: add "VieNeu-TTS-v3-Nano (preview)" to the model list; v3 Turbo (fp32) stays the default on CPU and GPU; CPU banner rewritten (no int8 recommendation). - Docs: Nano section with RTF table and quality caveats (weaker EN / bilingual). - Tests for the Nano engine and factory; version bump to 3.5.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>8562074
-
v3.4.0: SDK v3 Turbo mac dinh fp32 + sua watermark/UI theo issue #191
- SDK: precision mac dinh cua v3 Turbo (ONNX/CPU) doi int8 -> fp32; int8 thanh tuy chon Vieneu(precision="int8") (can CPU co VNNI). web_stream cung theo fp32. - Watermark (#191): go goi `perth` sai (thu vien threading) khoi deps + uv.lock; them extra `vieneu[watermark]` (resemble-perth, can torch). _init_watermarker canh bao ro thay vi nuot loi; Web UI chi hien dong "da dong dau" khi co watermarker. - Web UI (#191): sua info o Batch Processing (v3 chi can CUDA, khong can LMDeploy); bang vi du clone co cot transcript chi hien voi v2, v3 dung bang chi co audio. - Docs: bo nhan early access/preview cua v3 Turbo; them link v3 Turbo vao header Models cua Gradio; README ghi fp32 mac dinh. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>aeea38f
-
v3.3.0: cat chunk theo tu noi + doi giong Adam sang mien Nam
- Cat cuong buc theo tu (mảnh khong con dau cau > max_chars): uu tien cat TRUOC tu noi (va, nhung, hoac, roi, nen, vi, neu, khi, de, do, boi) thay vi chat sat tran giua cum danh tu; cap hai tu (sau khi, boi vi, tuy nhien...) coi la MOT tu noi, khong bao gio cat lot giua cap. - Manh trai phai >= max_chars//2 moi nhan diem cat tu nhien; khong co thi cat sat tran nhu cu (fallback nguyen trang). - Stress-test ~44k ranh gioi + fuzz 3000 vong; va loi cat lot giua cap chong lan (cho | den khi) khi tu noi nam duoi nguong min_left. - Doi giong Adam (voices_v3_turbo.json): region Tieng Anh -> Nam. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>e7df777
-
v3.2.12: chan cung ~1s cho chunk MOT tu + tran frame engine ONNX
- Codec 12.5 frame/s: cong thuc tuyen tinh van hao phong voi tu don (chao -> 40 frame = 3.2s bia). Mot tu duy nhat (khong emotion cue, phoneme <= 24 ky tu) -> chan cung 13 frame (~1s). - Gom ca fix f323dcb: tran frame trong engine ONNX (infer/infer_stream), doi xung voi engine PyTorch cua 3.2.11. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>376738f -
fix: them tran frame vao engine ONNX (infer + infer_stream)
Doi xung voi engine PyTorch trong 3.2.11 - nhanh CPU tuan tu cua gradio_main.py (goi thang tts.engine.infer) gio cung duoc bao ve. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>6b59aef -
v3.2.11: dua tran frame vao trong engine (per-row)
- generate_batch: tran frame RIENG tung row (frame_caps) - row cham tran cua chinh no thi mask ra khoi batch, khong an theo max_new_frames chung; retry guard giu dung cap cua row duoc sinh lai. - Engine don (infer/infer_stream): resolve phonemes truoc roi cap max_new_frames theo max_expected_frames; tham so frame_cap=False de tat. - Moi caller goi thang engine (HF Space, gradio_main) tu dong duoc bao ve, khong can tu ap tran nhu 3.2.10. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>c1df03d -
v3.2.10: chong ao giac chunk ngan (gop chunk vun + tran frame theo phoneme)
- normalize_to_chunks_v3(_with_gaps): chunk < 20 ky tu thuc (bo emotion token) duoc gop vao chunk ke - dong tieu de / thoai cut 1-2 tu khong con dung rieng gay ao giac. - max_expected_frames = 24 + 2.0 x len(phoneme bo markup): tran chan-tren cho max_new_frames o ca 3 duong (tuan tu, batch theo group, stream), doi xung voi guard chan-duoi 0.25 frame/phoneme. Hang so do tren dataset vi-tts-v3-finetune-mix (129,790 rows, phu 99.9915%). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>cd8cf9c -
feat: doi giong mac dinh v3 Turbo sang Adam
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>8f522e1 -
v3.2.9: voice cloning torch-free tren CPU/ONNX (kaldi-native-fbank + soxr)
Fix crash 'No module named torch' khi clone giong tren ban cai mac dinh (pip install vieneu): front-end fbank cua speaker encoder truoc day import cung torch/torchaudio. Thay bang kaldi-native-fbank (fbank y het, x-vec cos=1.0 tren cung input 16k) + soxr resample; toan bo pipeline cloning (denoise -> x-vector -> ref codes) gio chay thuan numpy + onnxruntime. - speaker/audio_utils.py, fbank.py, onnx_extractor.py: bo torch, dung numpy; van nhan input torch.Tensor tu engine GPU (duck-typing .detach()) - them kaldi-native-fbank>=1.20 vao core deps (fallback torchaudio cho env cu) - x-vector parity vs pipeline cu: cos 0.9954-0.9999 (khac biet chi do resampler kaiser -> soxr); GPU va CPU gio cho speaker emb giong het nhau - test moi: tests/test_speaker_fbank.py (subprocess chan torch lam regression) - README x3: bo ghi chu 'cloning can PyTorch engine' Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>63cac34
-
v3.2.8: them giong tieng Anh Adam (20 preset voices)
- Them preset Adam (nam, tieng Anh) vao voices_v3_turbo.json: speaker embedding 192-d + 39 frame MOSS ref codes, trich xuat qua speaker encoder va MOSS encode (ONNX). - README: 19 -> 20 preset voices, them muc English. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>16a4cd2 -
v3.2.7: sliding-window repetition penalty, 19 voices, max_new_frames 300
- Repetition penalty doi sang cua so truot (RepetitionHistory, window=64 frame ~2.5s): chi phat code trong cua so gan nhat thay vi phat vinh vien ca chunk — het nguy co troi giong cuoi chunk dai. Ap dung dong bo ca 3 duong: PyTorch, ONNX/CPU, batched serve. Tham so moi `repetition_window` (0 = hanh vi cu), kem tests/test_rep_history.py. - Xoa giong Son Tran khoi voices_v3_turbo.json (20 -> 19 giong). - Giam mac dinh max_new_frames 600 -> 300 (SDK + gradio app). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>39b52cd -
v3.2.6: 20 preset voices (add 6 new voices)
- voices_v3_turbo.json: 14 -> 20 curated preset voices - README: update voice count and regional examples - Bump version to 3.2.6 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>c985191
-
Chia chunk theo ranh giới câu, nhận biết trích dẫn; max_new_frames 600
Chia chunk ---------- Trước đây thứ tự là normalize -> tách câu. Normalizer của sea-g2p xoá sạch dấu ngoặc ("..." / (...) -> dấu phẩy), nên khi tách câu thì mọi dấu .!? trong trích dẫn đều bị nhầm là kết câu. Câu Có phải ... kiểu như: "Rồi sao nữa? Mình phải tiếp tục đến bao giờ?", đúng không anh? bị vỡ thành 4 mảnh, mảnh cuối ", đúng không anh?" mở đầu bằng dấu phẩy — không phải một câu. Với max_chars=384 nó thành chunk riêng 17 ký tự, bị punc_norm ép "?" -> "." (luật câu < 5 từ) nên mất luôn ngữ điệu hỏi, rồi được chèn 0.18s im lặng phía trước. Đảo thứ tự thành: tách câu trên text THÔ (nhận biết ngoặc/trích dẫn) -> normalize từng câu -> đóng gói theo độ dài ĐÃ chuẩn hoá -> chốt dấu câu cuối mỗi chunk. Vẫn giữ tính chất cũ là đo độ dài sau normalize nên chunk không phình khi normalizer nở text ("100$" -> "một trăm u s d"). Cùng câu trên, max_chars=384 giờ ra [105, 296] — cắt đúng ở dấu chấm, khớp trực giác người đọc. Cửa sổ xấu 388-396 biến mất; mọi max_chars 300-396 đều cho cùn…02de74a
-
v3.2.4: batch anti-drop guard + length bucketing, default voice Minh Duc
- v3_turbo_serve: guard in generate_batch — rows shorter than 0.25 frames per phoneme char (markup stripped, floor 3) are regenerated up to 2x, keeping the longest attempt; core loop split into _generate_codes_batch - Length bucketing (sort chunks by phoneme length before batching) in v3turbo._infer_chunks and both gradio batch paths — less left-padding - gradio sequential path: keep empty wavs so v3_gaps stays aligned on join - Default v3 Turbo voice -> Minh Duc (voices_v3_turbo.json + README examples) - Bump sea-g2p to >=0.7.31 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>58300c1
-
fix(v3turbo): harden tempfile handling for SonarQube S5443 compliance
google-labs-jules[bot] +1: pnnbao97Refactored `_preclean_reference_audio` in `src/vieneu/v3turbo.py` to use a secure user-specific temporary directory with restricted `0o700` permissions (fallback to `./outputs/tmp`), passing the path explicitly to `tempfile.mkstemp` to comply with SonarQube's S5443 security rules. Also added robust cleanup handlers to ensure temporary audio pre-clean files are removed immediately after clone reference extraction, while employing strict resolved Path comparisons to safeguard original user reference audio files from any deletion. Co-authored-by: pnnbao97 <179232022+pnnbao97@users.noreply.github.com>18e0c2f -
fix(v3turbo): harden temporary reference path handling for clone preclean
8b72a77 -
feat: pre-clean clone reference audio in v3turbo
dbf6482 -
feat: pre-clean clone reference audio in v3turbo
a9fcc3a
-
feat(sdk): auto-batch v3 Turbo on GPU; slim GPU packaging
Batch inference for GPU users with zero API change: - v3turbo: infer()/infer_batch() now route chunks through the existing static-batching engine (vieneu.v3_turbo_serve) on the PyTorch/GPU backend. A long infer(text) batches its chunks in one forward; infer_batch([...]) batches chunks across all texts. Add max_batch_size (default 32) and a per-call batch_size override (batch_size=1 forces sequential). CPU/ONNX path is unchanged: torch-free and sequential. Packaging: - Drop the [gpu] extra — pip cannot pull a CUDA torch from an extra (uv.sources only apply under uv), so a torch-carrying [gpu] would be misleading on Windows. GPU is now a documented manual step (CUDA torch via the PyTorch index + transformers>=4.51). Move legacy backends (llama-cpp/lmdeploy/librosa/neucodec) to a new [legacy] extra. Re-lock. Docs: - Split CPU vs GPU install in all three READMEs, pin torch==2.8.0, drop stale v1/v2 SDK examples, and fix the model-overview tables to center v3 Turbo. Co…50c92b9 -
Fix Safari streaming: use fetch+WebAudio; DataView bugfix
PHAM NGUYEN NGOC BAO6b38a84 -
claude
eccf165
-
feat(v3turbo): int8 backbone by default on CPU (~1.6x faster), fp32 opt-out
The 12-layer fp32 backbone was ~58% of per-frame CPU cost. Quantizing it to int8 (per-channel, reduce_range for non-VNNI AVX2) makes decode_step ~3x faster (21.7 -> 7.0 ms/frame) and the weights ~4x smaller (415MB -> 99MB), with voice quality confirmed by ear across multiple voices/utterances (single-step hidden cosine 0.9996; trajectory divergence is benign stochastic-sampling chaos, not degradation — RMS/peak/EOS-timing all match fp32). - ONNX engine default subfolder -> `onnx_int8` (int8 backbone); `onnx_update` = fp32 - `Vieneu(precision="int8"|"fp32")` toggle (int8 default); explicit `onnx_subfolder` still overrides. Only affects the CPU/ONNX path (GPU stays PyTorch). - Gradio: two backbone options — "VieNeu-TTS-v3-Turbo (int8)" (default) and "VieNeu-TTS-v3-Turbo" (fp32/quality) — plus a CPU advisory note. Requires the `onnx_int8` subfolder on the model repo (uploaded separately). Bump 3.1.4 -> 3.2.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>4e0e0ca -
Remove unnecessary comments in onnx_runtime_lite.py
Unverified signatureRemoved comments about the Hub's download counter and local directory handling.331a8e2