5 Commits
Author SHA1 Message Date
Nighthawk b0588a0c93 Added initial API code and documentation. 2026-02-18 01:38:09 -05:00
Kedara Studios 837960761b chore: relax transformers and accelerate version pins to >= minimum 2026-02-06 16:31:24 +01:00
Kedara Studios f83f18439d fix: add repetition penalty to streaming and sync upstream finetuning
Streaming inference (voice clone) - repetition penalty:

Without repetition penalty, the model can fall into a degenerate state
where it keeps sampling the same codec tokens over and over. This
manifests as:
- Looping audio: the same syllable or sound fragment repeats endlessly
- Extremely long generation: instead of reaching EOS in ~200-500 frames,
  it runs for thousands of frames (up to max_frames=10000)
- Apparent "slowness": a response that should take ~1s of audio takes
  10-30s to generate

The fix works by tracking previously generated first-codebook token IDs
and penalizing them before sampling:
- Tokens with positive logits get divided by repetition_penalty (lowering
  their probability)
- Tokens with negative logits get multiplied by it (pushing them further
  down)

This nudges the model away from re-selecting the same tokens, so it
progresses through the text naturally and reaches EOS in a reasonable
number of steps rather than looping. Default is 1.0 (disabled) and is
exposed through the supported_params whitelist in
stream_generate_voice_clone() so it can be set via generate_config or
user kwargs.

Upstream sync (QwenLM/Qwen3-TTS):
- Bump version 0.0.4 -> 0.1.1 to match upstream release.
- finetuning/sft_12hz.py: weight sub-talker loss by 0.3 factor to
  prevent the code predictor gradient from dominating the main talker
  loss during SFT.
- finetuning/sft_12hz.py: remove sub-codebook embedding accumulation
  loop (codec groups 1-15) from input embeddings, unnecessary and
  harmful for finetuning convergence (upstream PR #178).
- finetuning/README.md: update recommended hyperparameters to
  batch_size=32, lr=2e-6, num_epochs=10 for more stable training.
2026-02-06 16:25:05 +01:00
Xiong Wang d5c446171a fix: hf speech_tokenizer download bug. 2026-01-22 23:34:21 +08:00
Xiong Wang d8146d5305 Initial commit 2026-01-22 17:57:04 +08:00