Kazeia-engine/dist/jni
Richard Loyer b27c8ef403 chantier B TTS #10: tokenizer Qwen3 BPE via llama_tokenize, texte arbitraire
Plutôt que de porter Qwen3 BPE (NFC + pre-tokenize regex Unicode + ByteLevel +
merges + ignore_merges) à la main en C++ (~500 LOC risquées), on charge
n'importe quelle Qwen3 GGUF en vocab_only=true (~50 MB RAM, pas de poids) et
on appelle llama_tokenize(parse_special=true). Bit-exact garanti par
construction.

kazeia_text_tokenizer.h/cpp : API courte
  kz_tok_load(tok, gguf_path) / kz_tok_free / kz_tok_encode
  kz_tok_encode_tts_prompt(tok, content) -> enveloppe dans le template chat
    <|im_start|>assistant\n{content}<|im_end|>\n<|im_start|>assistant\n
  (déduit du dump golden : 16 tokens pour 'Bonjour je m'appelle Kazeia').

test_tokenizer : binaire standalone vérifiant bit-exact vs input_ids_full.bin
  ./test_tokenizer Qwen3-4B-Q4_0.gguf tts_dump/input_ids_full.bin 'Bonjour je m'appelle Kazeia'
  -> OK BIT-EXACT (16/16 tokens identiques au golden HF).

tts_pipeline : si KZTTS_TEXT et KZTTS_VOCAB_GGUF posés, tokenize la phrase au
lieu de lire input_ids_full.bin. La structure attendue (3 role + Nt body + 5
trailing) est exactement ce que kz_tok_encode_tts_prompt produit, donc
input_ids_len = Nt + 8 sans rien d'autre à changer dans la construction
prefill_embeds.

Mesure tablette Pad3 (cpu 6t, KZTTS_CP_CACHE=1, seed=42) :
  A fixture        : 31 frames, total 7.866s, RTF 3.04
  B tokenizer C++  : 31 frames, total 7.842s, RTF 3.04  + WAV md5 identique
  C 'Bonsoir...'   : 41 frames audio 3.4s, total 10.5s, RTF 3.09 (phrase neuve OK)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 21:21:53 +02:00
..
EngineLlmEngine.kt chantier B TTS #1: API JNI embeds-only + M-RoPE qwen3 dense 2026-05-28 13:37:17 +02:00
build_prefill.cpp chantier B TTS #4: P3.1+P3.2 = x_vector + prefill_embeds depuis input_ids (bit-exact) 2026-05-28 15:05:23 +02:00
cp_inference.cpp chantier B TTS #9: CP weights f16 conservés, CP -52% cumulé, bit-exact 2026-05-28 21:14:21 +02:00
cp_inference.h chantier B TTS #8: KV cache CP -40% par frame, bit-exact 2026-05-28 19:51:22 +02:00
cp_validate.cpp chantier B TTS #5: P3.3 = vrai CP runner intégré (bit-exact) 2026-05-28 15:11:07 +02:00
dual_ctx.cpp dist: prefill HTP = CASSÉ (sortie charabia), prefill obligatoirement CPU 2026-05-27 09:42:59 +02:00
dual_ctx_mt.cpp dist: JNI option C câblé (prefill HTP / decode CPU), validé multi-tour 2026-05-27 10:24:55 +02:00
kazeia_engine_jni.cpp chantier B TTS #2: fix M-RoPE positions en embeds-mode + validation bit-exact 2026-05-28 13:54:03 +02:00
kazeia_text_tokenizer.cpp chantier B TTS #10: tokenizer Qwen3 BPE via llama_tokenize, texte arbitraire 2026-05-28 21:21:53 +02:00
kazeia_text_tokenizer.h chantier B TTS #10: tokenizer Qwen3 BPE via llama_tokenize, texte arbitraire 2026-05-28 21:21:53 +02:00
sampler.cpp chantier B TTS #7: sampler HF-style top_k+top_p+rep_penalty (générique) 2026-05-28 16:55:05 +02:00
sampler.h chantier B TTS #7: sampler HF-style top_k+top_p+rep_penalty (générique) 2026-05-28 16:55:05 +02:00
test_engine.c Valide device: generate() bout-en-bout OK (test_native), bridge pret integration 2026-05-24 22:05:44 +02:00
test_engine.cpp Valide device: generate() bout-en-bout OK (test_native), bridge pret integration 2026-05-24 22:05:44 +02:00
test_jni_native.cpp dist: multi-tour propre (generateRaw + ChatSession) + JNI validé end-to-end natif 2026-05-27 11:18:20 +02:00
test_native.cpp v4 fix #277: ngl0 CPU decode 14tok/s, 4s/tour, usable 2026-05-25 10:18:31 +02:00
test_talker.cpp chantier B TTS #1: API JNI embeds-only + M-RoPE qwen3 dense 2026-05-28 13:37:17 +02:00
test_talker_replay.cpp chantier B TTS #2: fix M-RoPE positions en embeds-mode + validation bit-exact 2026-05-28 13:54:03 +02:00
test_tokenizer.cpp chantier B TTS #10: tokenizer Qwen3 BPE via llama_tokenize, texte arbitraire 2026-05-28 21:21:53 +02:00
tts_orchestrate.cpp chantier B TTS #6: P3.4+P3.5 = pipeline complet 100% tablette bout-en-bout 2026-05-28 15:25:00 +02:00
tts_pipeline.cpp chantier B TTS #10: tokenizer Qwen3 BPE via llama_tokenize, texte arbitraire 2026-05-28 21:21:53 +02:00