Change voices available without voice cloning (#12)

This commit is contained in:
Gabriel de Marmiesse
2026-01-13 11:06:23 +01:00
committed by GitHub
parent f5b66f6e3e
commit 366aa68c23
5 changed files with 28 additions and 14 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
DEFAULT_AUDIO_PROMPT = "marius"
DEFAULT_AUDIO_PROMPT = "alba"
DEFAULT_VARIANT = "b6369a24"
DEFAULT_TEMPERATURE = 0.7
DEFAULT_LSD_DECODE_STEPS = 1
+3
View File
@@ -248,6 +248,9 @@ def generate(
# Only print the result message if not writing to stdout
if 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__":
+4 -1
View File
@@ -620,7 +620,10 @@ class TTSModel(nn.Module):
with display_execution_time("Encoding audio prompt"):
prompt = self._encode_audio(audio_conditioning.unsqueeze(0).to(self.device))
# 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)
+4 -7
View File
@@ -11,14 +11,11 @@ from torch import nn
PROJECT_ROOT = Path(__file__).parent.parent.parent
_voices_names = ["alba", "marius", "javert", "jean", "fantine", "cosette", "eponine", "azelma"]
PREDEFINED_VOICES = {
"marius": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/marius.safetensors",
"javert": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/javert.safetensors",
"jean": "hf://kyutai/pocket-tts-without-voice-cloning/embeddings/jean.safetensors",
"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",
# don't forget to change this
x: f"hf://kyutai/pocket-tts-without-voice-cloning/embeddings/{x}.safetensors"
for x in _voices_names
}