umarigan commited on
Commit
4c33080
·
verified ·
1 Parent(s): 14c06f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,8 +11,8 @@ synthesiser = pipeline("text-to-speech", "umarigan/speecht5_tts_tr_v1.0")
11
  embeddings_dataset = load_dataset("umarigan/turkish_voice_dataset_embedded", split="train")
12
 
13
  # Define the speech generation function
14
- def generate_speech(text, speaker_id):
15
- speaker_embedding = torch.tensor(embeddings_dataset[speaker_id]["speaker_embeddings"]).unsqueeze(0)
16
  speech = synthesiser(text, forward_params={"speaker_embeddings": speaker_embedding})
17
 
18
  # Save the generated audio to a file
 
11
  embeddings_dataset = load_dataset("umarigan/turkish_voice_dataset_embedded", split="train")
12
 
13
  # Define the speech generation function
14
+ def generate_speech(text):
15
+ speaker_embedding = torch.tensor(embeddings_dataset[768]["speaker_embeddings"]).unsqueeze(0)
16
  speech = synthesiser(text, forward_params={"speaker_embeddings": speaker_embedding})
17
 
18
  # Save the generated audio to a file