Views
No views yet
Qwen/Qwen3-TTS-12Hz-1.7B-Base for Saudi Arabian (Khaleeji/KSA) Arabic speech synthesis.vadimbelsky/KSA_Arabic_English_Dataset_13k — ~13 k Arabic utterances in the KSA dialect, filtered to 1–20 s duration.2072. Rather than initialising this embedding randomly, it was set to the mean of all existing language embeddings before training:1ARABIC_LANG_ID = 2072
2codec_emb = qwen3tts.model.talker.model.codec_embedding
3existing_ids = [v for k, v in config.talker_config.codec_language_id.items() if k != 'arabic']
4avg = codec_emb.weight[existing_ids].float().mean(0)
5codec_emb.weight[ARABIC_LANG_ID] = avgpos 3: codec_think_id
pos 4: codec_think_bos_id
pos 5: lang_id ← Arabic token 2072
pos 6: codec_think_eos_id
pos 7: speaker embedding slot ← shifted +1 vs. base model+8 to +9, and codec_embedding_mask[7] = False so the speaker embedding is injected directly from the speaker encoder.dataset.py detects Arabic automatically from Unicode range \u0600–\u06FF, so no explicit language field is needed per sample.3000 (ksa_speaker) was registered. The embedding is extracted from a reference KSA audio clip by the frozen speaker encoder and written directly into the safetensors weights — the saved model is fully self-contained.| Setting | Value |
|---|---|
| Base model | Qwen/Qwen3-TTS-12Hz-1.7B-Base |
| Training data | vadimbelsky/KSA_Arabic_English_Dataset_13k (Arabic subset) |
| Optimizer | AdamW, lr=2e-6, weight decay=0.01 |
| Precision | bf16 mixed precision |
| Gradient accumulation | 4 steps (effective batch ~32) |
| Gradient clipping | 1.0 |
| Epochs | 5 (this checkpoint: epoch 4) |
| Loss | talker_loss + 0.3 × sub_talker_loss |
pip install qwen-tts soundfile torch1import torch
2import soundfile as sf
3from qwen_tts.inference.qwen3_tts_model import Qwen3TTSModel
4
5tts = Qwen3TTSModel.from_pretrained(
6 "vadimbelsky/qwen3-TTS-KSA",
7 dtype=torch.bfloat16,
8 device_map="cuda:0",
9 attn_implementation="sdpa",
10)
11
12wavs, sr = tts.generate_custom_voice(
13 text="الحين سويت فنجال قهوة، توني صحيت من النوم",
14 speaker="ksa_speaker",
15 language="arabic",
16)
17sf.write("output.wav", wavs[0], sr)infer_ksa.py:1python infer_ksa.py \
2 --checkpoint vadimbelsky/qwen3-TTS-KSA \
3 --text "وين تبي تلتقي الحين؟" \
4 --output out_ksa.wav| Speaker name | Language |
|---|---|
ksa_speaker | arabic |