A TTS that fits in your CPU (and pocket)
Python
French: 6-layer model and a new 24-layer model (#321)
manu-lmeedf2ac821bf
diff --git a/docs/API Reference/python-api.md b/docs/API Reference/python-api.mdindex c29e38c..ad549a6 100644--- a/docs/API Reference/python-api.md+++ b/docs/API Reference/python-api.md@@ -42,7 +42,7 @@ The main class for text-to-speech generation.Load and return a TTSModel instance with pre-trained weights.**Parameters:**-- `language` (str | None): Name of built-in language config to load. Supported values: `"english_2026-01"`, `"english_2026-04"`, `"english"`, `"french_24l"`, `"german_24l"`, `"portuguese_24l"`, `"italian_24l"`, `"spanish_24l"`. If both `language` and `config` are omitted, defaults to `"english"`, which is the same model as `"english_2026-04"`. The "24l" variants are larger models that are not distilled yet and are here only as a preview.+- `language` (str | None): Name of built-in language config to load. Supported values: `"english_2026-01"`, `"english_2026-04"`, `"english"`, `"french"`, `"french_24l"`, `"german_24l"`, `"portuguese_24l"`, `"italian_24l"`, `"spanish_24l"`. If both `language` and `config` are omitted, defaults to `"english"`, which is the same model as `"english_2026-04"`. The "24l" variants are larger models that are not distilled yet and are here only as a preview.- `config` (str | None): Path to model config YAML file. Incompatible with `language`.- `temp` (float | None): Sampling temperature for generation. `None` uses the model's recommended default from its config file (`default_temperature`; 0.3 for the English model, 0.7 otherwise).- `sampler_decode_steps` (int): Number of generation steps (default: 1)diff --git a/docs/CLI Commands/export_voice.md b/docs/CLI Commands/export_voice.mdindex 865d55e..d60aaeb 100644--- a/docs/CLI Commands/export_voice.md+++ b/docs/CLI Commands/export_voice.md@@ -24,7 +24,7 @@ Only the first 30 seconds of the audio file will be processed.### Options- `--quiet`: Do not print any output except errors.-- `--language`: Language for the TTS model, one of `'english_2026-01'`, `'english_2026-04'`, `'english'`, `'french_24l'`, `'german_24l'`, `'portuguese_24l'`, `'italian_24l'`, `'spanish_24l'` (default: `english`, which is the same model as `'english_2026-04'`). Incompatible with `--config`. The "24l" variants are bigger models, not distilled yet and here only as preview.+- `--language`: Language for the TTS model, one of `'english_2026-01'`, `'english_2026-04'`, `'english'`, `'french'`, `'french_24l'`, `'german_24l'`, `'portuguese_24l'`, `'italian_24l'`, `'spanish_24l'` (default: `english`, which is the same model as `'english_2026-04'`). Incompatible with `--config`. The "24l" variants are bigger models, not distilled yet and here only as preview.- `--config`: Model config yaml path — a local path, an `https://` URL, or an `hf://` path. Incompatible with `--language`.## Examplesdiff --git a/docs/CLI Commands/serve.md b/docs/CLI Commands/serve.mdindex 3871b5f..8ebe07e 100644--- a/docs/CLI Commands/serve.md+++ b/docs/CLI Commands/serve.md@@ -17,7 +17,7 @@ This starts a server on `http://localhost:8000` with the default voice model.- `--host HOST`: Host to bind to (default: "localhost")- `--port PORT`: Port to bind to (default: 8000)- `--reload`: Enable auto-reload for development-- `--language`: Language for the TTS model, one of `'english_2026-01'`, `'english_2026-04'`, `'english'`, `'french_24l'`, `'german_24l'`, `'portuguese_24l'`, `'italian_24l'`, `'spanish_24l'` (default: `english`, which is the same model as `'english_2026-04'`). Incompatible with `--config`. The "24l" variants are bigger models, not distilled yet and here only as preview.+- `--language`: Language for the TTS model, one of `'english_2026-01'`, `'english_2026-04'`, `'english'`, `'french'`, `'french_24l'`, `'german_24l'`, `'portuguese_24l'`, `'italian_24l'`, `'spanish_24l'` (default: `english`, which is the same model as `'english_2026-04'`). Incompatible with `--config`. The "24l" variants are bigger models, not distilled yet and here only as preview.- `--config`: Path to a custom config .yaml — a local path, an `https://` URL, or an `hf://` path. Incompatible with `--language`.- `--default-voice`: Voice used by the requests that don't ask for one (default: the built-in voice of the language). It accepts anything the `generate --voice` option accepts: a built-in voice name, a local path to an audio file or to a `.safetensors` voice, an `https://` URL, or an `hf://` path. It is loaded at startup, so a voice that cannot be read fails the server immediately instead of the first request.- `--quantize`: Use int8 quantization for the model (default: False). This can reduce memory usage and increase speed, with minimal impact on audio quality.diff --git a/pocket_tts/config/french.yaml b/pocket_tts/config/french.yamlnew file mode 100644index 0000000..e88f2e6--- /dev/null+++ b/pocket_tts/config/french.yaml@@ -0,0 +1,60 @@+weights_path: hf://kyutai/pocket-tts/languages/french/model.safetensors@d0ebc5deb50bc6b225f686782f124dd37e2dca0a+weights_path_without_voice_cloning: hf://kyutai/pocket-tts-without-voice-cloning/languages/french/model.safetensors@8843db76457a91db32077edf8dfcd1c0e3e755fd++remove_semicolons: true++flow_lm:+ insert_bos_before_voice: true+ dtype: float32+ flow:+ depth: 6+ dim: 512+ transformer:+ d_model: 1024+ hidden_scale: 4+ max_period: 10000+ num_heads: 16+ num_layers: 6+ lookup_table:+ dim: 1024+ n_bins: 4000+ tokenizer: tokenizers+ tokenizer_path: hf://kyutai/pocket-tts-without-voice-cloning/languages/french/tokenizer.json@8843db76457a91db32077edf8dfcd1c0e3e755fd+ #weights_path: partial.safetensors++mimi:+ dtype: float32+ sample_rate: 24000+ inner_dim: 32+ outer_dim: 512+ channels: 1+ frame_rate: 12.5+ seanet:+ dimension: 512+ channels: 1+ n_filters: 64+ n_residual_layers: 1+ ratios:+ - 6+ - 5+ - 4+ kernel_size: 7+ residual_kernel_size: 3+ last_kernel_size: 3+ dilation_base: 2+ pad_mode: constant+ compress: 2+ transformer:+ d_model: 512+ num_heads: 8+ num_layers: 2+ layer_scale: 0.01+ context: 250+ dim_feedforward: 2048+ input_dimension: 512+ output_dimensions:+ - 512+ quantizer:+ dimension: 32+ output_dimension: 512+ #weights_path: codec.safetensorsdiff --git a/pocket_tts/config/french_24l.yaml b/pocket_tts/config/french_24l.yamlindex a771036..d8564ed 100644--- a/pocket_tts/config/french_24l.yaml+++ b/pocket_tts/config/french_24l.yaml@@ -1,10 +1,7 @@-# sig: 709d9f84.yaml--weights_path: hf://kyutai/pocket-tts/languages/french_24l/model.safetensors@39592ff23c9ef80098bb74895d104c26275fe2c9-weights_path_without_voice_cloning: hf://kyutai/pocket-tts-without-voice-cloning/languages/french_24l/model.safetensors@d29db7978e464fb90cb3359ee0c69a273b9142cc+weights_path: hf://kyutai/pocket-tts/languages/french_24l/model.safetensors@d0ebc5deb50bc6b225f686782f124dd37e2dca0a+weights_path_without_voice_cloning: hf://kyutai/pocket-tts-without-voice-cloning/languages/french_24l/model.safetensors@8843db76457a91db32077edf8dfcd1c0e3e755fdremove_semicolons: true-model_recommended_frames_after_eos: 8flow_lm:insert_bos_before_voice: true@@ -22,7 +19,7 @@ flow_lm:dim: 1024n_bins: 4000tokenizer: tokenizers- tokenizer_path: hf://kyutai/pocket-tts-without-voice-cloning/languages/french_24l/tokenizer.json@00eac05ed3d16bdc3f6b5d598874019c34a89214+ tokenizer_path: hf://kyutai/pocket-tts-without-voice-cloning/languages/french_24l/tokenizer.json@8843db76457a91db32077edf8dfcd1c0e3e755fd#weights_path: partial.safetensorsmimi:diff --git a/pocket_tts/main.py b/pocket_tts/main.pyindex a328906..5593e55 100644--- a/pocket_tts/main.py+++ b/pocket_tts/main.py@@ -217,7 +217,7 @@ def serve(str | None,typer.Option(help="Language for the TTS model. "- "'english_2026-01', 'english_2026-04', 'english', 'french_24l', 'german_24l', 'portuguese', 'italian', 'spanish'."+ "'english_2026-01', 'english_2026-04', 'english', 'french', 'french_24l', 'german_24l', 'portuguese', 'italian', 'spanish'."" Incompatible with the config argument. Default is 'english', which is the same model as 'english_2026-04'.",show_default=False,),@@ -283,7 +283,7 @@ def generate(typer.Option(help=("Language for the TTS model. "- "'english_2026-01', 'english_2026-04', 'english', 'french_24l', 'spanish_24l',"+ "'english_2026-01', 'english_2026-04', 'english', 'french', 'french_24l', 'spanish_24l',""'german_24l', 'portuguese_24l', 'italian_24l'."" Incompatible with the config argument. Default is 'english', which is the same model as 'english_2026-04'. ""The '24l' variants are bigger models, "@@ -404,7 +404,7 @@ def export_voice(typer.Option(help=("Language for the TTS model. "- "'english_2026-01', 'english_2026-04', 'english', 'french_24l', 'german_24l','spanish_24l',"+ "'english_2026-01', 'english_2026-04', 'english', 'french', 'french_24l', 'german_24l','spanish_24l',"" 'portuguese_24l', 'italian_24l'."" Incompatible with the config argument. Default is 'english', which is the same model as 'english_2026-04'. ""The '24l' variants are bigger models, "diff --git a/pocket_tts/models/tts_model.py b/pocket_tts/models/tts_model.pyindex c29369e..c66e741 100644--- a/pocket_tts/models/tts_model.py+++ b/pocket_tts/models/tts_model.py@@ -300,7 +300,7 @@ class TTSModel(nn.Module):Args:language: Optional language identifier to select a predefined config. Incompatible withthe `config` argument. Available options- are `"english_2026-01"`, `"english_2026-04"`, `"english"`, `"french_24l"`, `"german_24l"`, `"portuguese"`, `"italian"`, `"spanish_24l"`.+ are `"english_2026-01"`, `"english_2026-04"`, `"english"`, `"french"`, `"french_24l"`, `"german_24l"`, `"portuguese"`, `"italian"`, `"spanish_24l"`.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: a local path (e.g., `"C://pocket_tts/pocket_tts_config.yaml"`),an `https://` URL, or an `hf://` path (e.g. `"hf://<repo_id>/<path>[@revision]"`).@@ -351,10 +351,6 @@ class TTSModel(nn.Module):if config is None and language is None:language = DEFAULT_LANGUAGEif language is not None:- if language == "french":- raise ValueError(- "For technical reasons, only a larger 24-layer model is available for French. Please use the 'french_24l' language instead."- )config = CONFIGS_DIR / f"{language}.yaml"if lsd_decode_steps is not None:logger.warning("lsd_decode_steps is deprecated, use sampler_decode_steps")diff --git a/pocket_tts/utils/utils.py b/pocket_tts/utils/utils.pyindex 3494128..b15e44a 100644--- a/pocket_tts/utils/utils.py+++ b/pocket_tts/utils/utils.py@@ -47,7 +47,7 @@ _ORIGINS_OF_PREDEFINED_VOICES = {def get_predefined_voice(language: str, name: str) -> str:- return f"hf://kyutai/pocket-tts-without-voice-cloning/languages/{language}/embeddings/{name}.safetensors@e81d79e8194ad4c7ce879c87a4258ef20cbf2487"+ return f"hf://kyutai/pocket-tts-without-voice-cloning/languages/{language}/embeddings/{name}.safetensors@8843db76457a91db32077edf8dfcd1c0e3e755fd"def make_cache_directory() -> Path: