Web 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…
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>
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>
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>
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)…
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>
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>
v3.2.12: chan cung ~1s cho chunk MOT tu + tran frame engine ONNX
- 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>
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…
Bump version to 2.4.1: Modernize test suite and fix Turbo/Remote bugs