mirror of
https://github.com/index-tts/index-tts.git
synced 2026-08-29 07:13:37 +08:00
e9237d4152
`infer_generator()` parses `do_sample` out of `generation_kwargs` and then
never uses it — the call to `inference_speech()` passes a literal `True`:
indextts/infer_v2.py:536 do_sample = generation_kwargs.pop("do_sample", True)
indextts/infer_v2.py:589 do_sample=True,
indextts/infer_v2_5.py:731 do_sample = generation_kwargs.pop("do_sample", True)
indextts/infer_v2_5.py:780 do_sample=True,
In both files the parsed local is dead: those two lines are its only mentions.
Because the value is `pop`ped rather than left in `generation_kwargs`, passing
`do_sample=False` is swallowed silently instead of reaching the model, so greedy
decoding has never been reachable through the public `infer()` API.
The value does have somewhere to arrive: `inference_speech()` collects
`**hf_generate_kwargs` and forwards them to `GPT2InferenceModel.generate()`
(`indextts/gpt/model_v2.py:820`, `indextts/gpt/model_v2_5.py:779`), which is
where HuggingFace reads `do_sample`.
Default behaviour is unchanged — the `pop` default is still `True`, and only an
explicit `do_sample=False` now takes effect.
Fixes #577. Supersedes #726, which fixed the v2 site only; 2.5 is the current
default path and had the same defect.
Verified: `uv run --extra test pytest -m "not gpu"` — 151 passed, with two
`test_model_download_reachable` failures from HuggingFace CDN SSL resets that
reproduce on unmodified main.