Default the English model's temperature to 0.3 (#223)

## Motivation

Human evaluations consistently prefer the English model at temperature
**0.3** over the current default **0.7**, and the change is free on
every objective axis we measured.
This commit is contained in:
Manu Orsini
2026-07-16 14:42:04 +02:00
committed by GitHub
parent 9514983efd
commit d108410d23
7 changed files with 20 additions and 9 deletions
+2
View File
@@ -2,6 +2,8 @@
weights_path: hf://kyutai/pocket-tts/languages/english/model.safetensors@39592ff23c9ef80098bb74895d104c26275fe2c9
weights_path_without_voice_cloning: hf://kyutai/pocket-tts-without-voice-cloning/languages/english/model.safetensors@d29db7978e464fb90cb3359ee0c69a273b9142cc
# Human evals preferred this model at 0.3 (equal WER/similarity/speech rate).
default_temperature: 0.3
flow_lm:
+2
View File
@@ -2,6 +2,8 @@
weights_path: hf://kyutai/pocket-tts/languages/english_2026-04/model.safetensors@19f95fe2df36e79fbd9f10008595cc4c977a0fcc
weights_path_without_voice_cloning: hf://kyutai/pocket-tts-without-voice-cloning/languages/english_2026-04/model.safetensors@d29db7978e464fb90cb3359ee0c69a273b9142cc
# Human evals preferred this model at 0.3 (equal WER/similarity/speech rate).
default_temperature: 0.3
flow_lm:
+6 -3
View File
@@ -20,7 +20,6 @@ from pocket_tts.default_parameters import (
DEFAULT_FRAMES_AFTER_EOS,
DEFAULT_LSD_DECODE_STEPS,
DEFAULT_NOISE_CLAMP,
DEFAULT_TEMPERATURE,
MAX_TOKEN_PER_CHUNK,
get_default_text_for_language,
get_default_voice_for_language,
@@ -261,8 +260,12 @@ def generate(
int, typer.Option(help="Number of generation steps")
] = DEFAULT_LSD_DECODE_STEPS,
temperature: Annotated[
float, typer.Option(help="Temperature for generation")
] = DEFAULT_TEMPERATURE,
float | None,
typer.Option(
help="Temperature for generation. Defaults to the model's recommended "
"value from its config (0.3 for the English model, 0.7 otherwise)."
),
] = None,
noise_clamp: Annotated[float, typer.Option(help="Noise clamp value")] = DEFAULT_NOISE_CLAMP,
eos_threshold: Annotated[float, typer.Option(help="EOS threshold")] = DEFAULT_EOS_THRESHOLD,
frames_after_eos: Annotated[
+6 -3
View File
@@ -25,7 +25,6 @@ from pocket_tts.default_parameters import (
DEFAULT_LANGUAGE,
DEFAULT_LSD_DECODE_STEPS,
DEFAULT_NOISE_CLAMP,
DEFAULT_TEMPERATURE,
MAX_TOKEN_PER_CHUNK,
)
from pocket_tts.models.flow_lm import FlowLMModel
@@ -234,7 +233,7 @@ class TTSModel(nn.Module):
cls,
language: str | None = None,
config: str | Path | None = None,
temp: float | int = DEFAULT_TEMPERATURE,
temp: float | int | None = None,
lsd_decode_steps: int = DEFAULT_LSD_DECODE_STEPS,
noise_clamp: float | int | None = DEFAULT_NOISE_CLAMP,
eos_threshold: float = DEFAULT_EOS_THRESHOLD,
@@ -253,7 +252,9 @@ class TTSModel(nn.Module):
If neither `config` nor `language` is provided, defaults to `"english", which is the same model as 'english_2026-04'`.
config: A path to a custom YAML config file saved locally (e.g., `"C://pocket_tts/pocket_tts_config.yaml"`).
temp: Sampling temperature for generation. Higher values produce more
diverse but potentially lower quality output.
diverse but potentially lower quality output. If None, defaults to
the model's recommended value from its config file
(``default_temperature``, e.g. 0.3 for the English model).
lsd_decode_steps: Number of steps for Lagrangian Self Distillation
decoding. More steps can improve quality but increase computation.
noise_clamp: Maximum value for noise sampling. If None, no clamping
@@ -303,6 +304,8 @@ class TTSModel(nn.Module):
raise ValueError("Config should be a path to a YAML file ending with .yaml")
config_path = Path(config)
config = load_config(config_path)
if temp is None:
temp = config.default_temperature
logger.info(f"Loading model from config at {config_path}...")
tts_model = TTSModel._from_pydantic_config_with_weights(
+1
View File
@@ -116,6 +116,7 @@ class Config(StrictModel):
pad_with_spaces_for_short_inputs: bool = False
remove_semicolons: bool = False
model_recommended_frames_after_eos: int | None = None
default_temperature: float = 0.7
def load_config(yaml_path: str | Path) -> Config: