Change voices available without voice cloning (#12)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Pocket TTS
|
# Pocket TTS
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
A lightweight text-to-speech (TTS) application designed to run efficiently on CPUs.
|
A lightweight text-to-speech (TTS) application designed to run efficiently on CPUs.
|
||||||
Forget about the hassle of using GPUs and web APIs serving TTS models. With Kyutai's Pocket TTS, generating audio is just a pip install and a function call away.
|
Forget about the hassle of using GPUs and web APIs serving TTS models. With Kyutai's Pocket TTS, generating audio is just a pip install and a function call away.
|
||||||
@@ -43,12 +43,23 @@ uvx pocket-tts generate
|
|||||||
# or if you installed it manually with pip:
|
# or if you installed it manually with pip:
|
||||||
pocket-tts generate
|
pocket-tts generate
|
||||||
```
|
```
|
||||||
Modify the voice with `--voice` and the text with `--text`. We provide a small catalog of voices:
|
Modify the voice with `--voice` and the text with `--text`. We provide a small catalog of voices.
|
||||||
```
|
|
||||||
"marius", "javert", "jean", "fantine", "cosette", "eponine", "azelma"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
You can take a look at [this page](https://huggingface.co/kyutai/tts-voices) which details the licenses
|
||||||
|
for each voice.
|
||||||
|
|
||||||
|
* [alba](https://huggingface.co/kyutai/tts-voices/blob/main/alba-mackenna/casual.wav)
|
||||||
|
* [marius](https://huggingface.co/kyutai/tts-voices/blob/main/voice-donations/Selfie.wav)
|
||||||
|
* [javert](https://huggingface.co/kyutai/tts-voices/blob/main/voice-donations/Butter.wav)
|
||||||
|
* [jean](https://huggingface.co/kyutai/tts-voices/blob/main/ears/p010/freeform_speech_01.wav)
|
||||||
|
* [fantine](https://huggingface.co/kyutai/tts-voices/blob/main/vctk/p244_023.wav)
|
||||||
|
* [cosette](https://huggingface.co/kyutai/tts-voices/blob/main/expresso/ex04-ex02_confused_001_channel1_499s.wav)
|
||||||
|
* [eponine](https://huggingface.co/kyutai/tts-voices/blob/main/vctk/p262_023.wav)
|
||||||
|
* [azelma](https://huggingface.co/kyutai/tts-voices/blob/main/vctk/p303_023.wav)
|
||||||
|
|
||||||
|
The `--voice` argument can also take a plain wav file as input for voice cloning.
|
||||||
Feel free to check out the [generate documentation](https://github.com/kyutai-labs/pocket-tts/tree/main/docs/generate.md) for more details and examples.
|
Feel free to check out the [generate documentation](https://github.com/kyutai-labs/pocket-tts/tree/main/docs/generate.md) for more details and examples.
|
||||||
|
For trying multiple voices and prompts quickly, prefer using the `serve` command.
|
||||||
|
|
||||||
### The `serve` command
|
### The `serve` command
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
DEFAULT_AUDIO_PROMPT = "marius"
|
DEFAULT_AUDIO_PROMPT = "alba"
|
||||||
DEFAULT_VARIANT = "b6369a24"
|
DEFAULT_VARIANT = "b6369a24"
|
||||||
DEFAULT_TEMPERATURE = 0.7
|
DEFAULT_TEMPERATURE = 0.7
|
||||||
DEFAULT_LSD_DECODE_STEPS = 1
|
DEFAULT_LSD_DECODE_STEPS = 1
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ def generate(
|
|||||||
# Only print the result message if not writing to stdout
|
# Only print the result message if not writing to stdout
|
||||||
if output_path != "-":
|
if output_path != "-":
|
||||||
logger.info("Results written in %s", output_path)
|
logger.info("Results written in %s", output_path)
|
||||||
|
logger.info(
|
||||||
|
"If you want to try multiple voices and prompts quickly, try the `serve` command."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -620,7 +620,10 @@ class TTSModel(nn.Module):
|
|||||||
with display_execution_time("Encoding audio prompt"):
|
with display_execution_time("Encoding audio prompt"):
|
||||||
prompt = self._encode_audio(audio_conditioning.unsqueeze(0).to(self.device))
|
prompt = self._encode_audio(audio_conditioning.unsqueeze(0).to(self.device))
|
||||||
# import safetensors.torch
|
# import safetensors.torch
|
||||||
# safetensors.torch.save_file({"audio_prompt": prompt}, "embeddings/eponine.safetensors")
|
# safetensors.torch.save_file(
|
||||||
|
# {"audio_prompt": prompt},
|
||||||
|
# "/projects/huggingface/pocket-tts/embeddings/cosette.safetensors"
|
||||||
|
# )
|
||||||
|
|
||||||
model_state = init_states(self.flow_lm, batch_size=1, sequence_length=1000)
|
model_state = init_states(self.flow_lm, batch_size=1, sequence_length=1000)
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,11 @@ from torch import nn
|
|||||||
|
|
||||||
PROJECT_ROOT = Path(__file__).parent.parent.parent
|
PROJECT_ROOT = Path(__file__).parent.parent.parent
|
||||||
|
|
||||||
|
_voices_names = ["alba", "marius", "javert", "jean", "fantine", "cosette", "eponine", "azelma"]
|
||||||
PREDEFINED_VOICES = {
|
PREDEFINED_VOICES = {
|
||||||
"marius": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/marius.safetensors",
|
# don't forget to change this
|
||||||
"javert": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/javert.safetensors",
|
x: f"hf://kyutai/pocket-tts-without-voice-cloning/embeddings/{x}.safetensors"
|
||||||
"jean": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/jean.safetensors",
|
for x in _voices_names
|
||||||
"fantine": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/fantine.safetensors",
|
|
||||||
"cosette": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/cosette.safetensors",
|
|
||||||
"eponine": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/eponine.safetensors",
|
|
||||||
"azelma": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/azelma.safetensors",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user