Spaces:
Running
Running
Update app.py
Browse files
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
|
15 |
-
speaker_embedding = torch.tensor(embeddings_dataset[
|
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
|