Add french, italian, portuguese, spanish, german (#155)
The french 6 layers variant wasn't included because it's not good enough yet. Use the `french_24l` variant for now.
This commit is contained in:
@@ -37,16 +37,18 @@ The main class for text-to-speech generation.
|
||||
|
||||
#### Class Methods
|
||||
|
||||
##### `load_model(config="b6369a24", temp=0.7, lsd_decode_steps=1, noise_clamp=None, eos_threshold=-4.0)`
|
||||
##### `load_model(language=None, config=None, temp=0.7, lsd_decode_steps=1, noise_clamp=None, eos_threshold=-4.0, quantize=False)`
|
||||
|
||||
Load and return a TTSModel instance with pre-trained weights.
|
||||
|
||||
**Parameters:**
|
||||
- `config` (str): Path to model config YAML file or a variant identifier (default: "b6369a24")
|
||||
- `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.
|
||||
- `config` (str | None): Path to model config YAML file. Incompatible with `language`.
|
||||
- `temp` (float): Sampling temperature for generation (default: 0.7)
|
||||
- `lsd_decode_steps` (int): Number of generation steps (default: 1)
|
||||
- `noise_clamp` (float | None): Maximum value for noise sampling (default: None)
|
||||
- `eos_threshold` (float): Threshold for end-of-sequence detection (default: -4.0)
|
||||
- `quantize` (bool): Enable int8 quantization when loading the model (default: `False`)
|
||||
|
||||
**Returns:**
|
||||
- `TTSModel`: Loaded model instance on CPU
|
||||
@@ -59,7 +61,9 @@ from pocket_tts import TTSModel
|
||||
model = TTSModel.load_model()
|
||||
|
||||
# Load with custom parameters
|
||||
model = TTSModel.load_model(variant="b6369a24", temp=0.5, lsd_decode_steps=5, eos_threshold=-3.0)
|
||||
model = TTSModel.load_model(
|
||||
language="english_2026-01", temp=0.5, lsd_decode_steps=5, eos_threshold=-3.0
|
||||
)
|
||||
```
|
||||
|
||||
#### Properties
|
||||
@@ -255,4 +259,4 @@ scipy.io.wavfile.write("batch_output.wav", model.sample_rate, full_audio.numpy()
|
||||
### Streaming to File
|
||||
You can refer to our CLI implementation which can stream audio to a wav file.
|
||||
|
||||
For more information about the command-line interface, see the [Generate Documentation](generate.md) or [Serve Documentation](serve.md).
|
||||
For more information about the command-line interface, see the [Generate Documentation](generate.md) or [Serve Documentation](serve.md).
|
||||
|
||||
@@ -24,7 +24,8 @@ Only the first 30 seconds of the audio file will be processed.
|
||||
### Options
|
||||
|
||||
- `--quiet`: Do not print any output except errors.
|
||||
- `--config`: Model config path or signature
|
||||
- `--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.
|
||||
- `--config`: Model config local yaml path. Incompatible with `--language`.
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
@@ -19,10 +19,11 @@ This will generate a WAV file `./tts_output.wav` with the default text and voice
|
||||
- `--text TEXT`: Text to generate (default: "Hello world! I am Kyutai Pocket TTS. I'm fast enough to run on small CPUs. I hope you'll like me.")
|
||||
- `--voice VOICE`: Path to audio conditioning file (voice to clone) (default: "hf://kyutai/tts-voices/alba-mackenna/casual.wav"). Urls and local paths are supported.
|
||||
- `--output-path OUTPUT_PATH`: Output path for generated audio (default: "./tts_output.wav")
|
||||
- `--language 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.
|
||||
|
||||
### Generation Parameters
|
||||
|
||||
- `--config CONFIG_PATH`: Path to custom config.yaml (for loading local model files) or model signature (default: "b6369a24")
|
||||
- `--config CONFIG_PATH`: Path to custom config.yaml (for loading local model files). Incompatible with `--language`.
|
||||
- `--lsd-decode-steps LSD_DECODE_STEPS`: Number of generation steps (default: 1)
|
||||
- `--temperature TEMPERATURE`: Temperature for generation (default: 0.7)
|
||||
- `--noise-clamp NOISE_CLAMP`: Noise clamp value (default: None)
|
||||
@@ -32,6 +33,7 @@ This will generate a WAV file `./tts_output.wav` with the default text and voice
|
||||
### Performance Options
|
||||
|
||||
- `--device DEVICE`: Device to use (default: "cpu", you may not get a speedup by using a gpu since it's a small model)
|
||||
- `--quantize`: Use int8 quantization for the model (default: False). This can reduce memory usage and increase speed, with minimal impact on audio quality.
|
||||
- `--quiet`, `-q`: Disable logging output
|
||||
|
||||
## Examples
|
||||
@@ -79,7 +81,7 @@ pocket-tts generate --eos-threshold -3.0
|
||||
|
||||
If you'd like to override the paths from which the models are loaded, you can provide a custom YAML configuration.
|
||||
|
||||
Copy pocket_tts/config/b6369a24.yaml and change weights_path:, weights_path_without_voice_cloning: and tokenizer_path: to the paths of the models you want to load.
|
||||
Copy one of the files in `pocket_tts/config` (for example `pocket_tts/config/english.yaml`) and change `weights_path`, `weights_path_without_voice_cloning`, and `tokenizer_path` to the paths of the models you want to load.
|
||||
|
||||
Then, use the --config option to point to your newly created config.
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ This starts a server on `http://localhost:8000` with the default voice model.
|
||||
|
||||
## Command Options
|
||||
|
||||
- `--voice VOICE`: Path to voice prompt audio file (voice to clone) (default: "hf://kyutai/tts-voices/alba-mackenna/casual.wav")
|
||||
- `--host HOST`: Host to bind to (default: "localhost")
|
||||
- `--port PORT`: Port to bind to (default: 8000)
|
||||
- `--reload`: Enable auto-reload for development
|
||||
- `--config`: Path to a custom config .yaml
|
||||
|
||||
- `--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.
|
||||
- `--config`: Path to a custom config .yaml. Incompatible with `--language`.
|
||||
- `--quantize`: Use int8 quantization for the model (default: False). This can reduce memory usage and increase speed, with minimal impact on audio quality.
|
||||
## Examples
|
||||
|
||||
### Basic Server
|
||||
@@ -32,21 +32,17 @@ pocket-tts serve
|
||||
pocket-tts serve --host "localhost" --port 8080
|
||||
```
|
||||
|
||||
### Custom Voice
|
||||
|
||||
### Custom Language
|
||||
To select the default language model, pass `--language`:
|
||||
```bash
|
||||
# Use different voice
|
||||
pocket-tts serve --voice "hf://kyutai/tts-voices/jessica-jian/casual.wav"
|
||||
|
||||
# Use local voice file
|
||||
pocket-tts serve --voice "./my_voice.wav"
|
||||
pocket-tts serve --language french_24l
|
||||
```
|
||||
|
||||
### Custom Model Config
|
||||
|
||||
If you'd like to override the paths from which the models are loaded, you can provide a custom YAML configuration.
|
||||
|
||||
Copy pocket_tts/config/b6369a24.yaml and change weights_path:, weights_path_without_voice_cloning: and tokenizer_path: to the paths of the models you want to load.
|
||||
Copy one of the files in `pocket_tts/config` (for example `pocket_tts/config/english.yaml`) and change `weights_path`, `weights_path_without_voice_cloning:`, and `tokenizer_path:` to the paths of the models you want to load.
|
||||
|
||||
Then, use the --config option to point to your newly created config.
|
||||
|
||||
@@ -60,4 +56,3 @@ pocket-tts serve --config "C://pocket-tts/my_config.yaml"
|
||||
Once the server is running, navigate to `http://localhost:8000` to access the web interface.
|
||||
|
||||
For more advanced usage, see the [Python API documentation](python-api.md) for direct integration with the TTS model.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user