Spaces:
Runtime error
Runtime error
Sandiago21
commited on
Commit
•
3406513
1
Parent(s):
f8c1cd0
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
|
10 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
11 |
speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)
|
12 |
|
13 |
-
# checkpoint = "microsoft/speecht5_tts"
|
14 |
processor = SpeechT5Processor.from_pretrained(model_id)
|
15 |
|
16 |
replacements = [
|
@@ -96,6 +95,14 @@ replacements = [
|
|
96 |
]
|
97 |
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
def cleanup_text(text):
|
100 |
for src, dst in replacements:
|
101 |
text = text.replace(src, dst)
|
@@ -114,4 +121,6 @@ syntesize_speech_gradio = gr.Interface(
|
|
114 |
inputs = gr.Textbox(label="Text", placeholder="Type something here..."),
|
115 |
outputs=gr.Audio(),
|
116 |
examples=["Έλαβαν χώρα μεγάλες διαδηλώσεις στην Πολωνία όταν εκείνη η χώρα υπέγραψε την acta που οδήγησε την κυβέρνηση της πολωνίας να αποφασίσει τη μη επικύρωση της συμφωνίας προς το παρόν"],
|
|
|
|
|
117 |
).launch()
|
|
|
10 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
11 |
speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)
|
12 |
|
|
|
13 |
processor = SpeechT5Processor.from_pretrained(model_id)
|
14 |
|
15 |
replacements = [
|
|
|
95 |
]
|
96 |
|
97 |
|
98 |
+
title = "Text-to-Speech"
|
99 |
+
description = """
|
100 |
+
Demo for text-to-speech translation in Greek. Demo uses [Sandiago21/speecht5_finetuned_google_fleurs_greek](https://huggingface.co/Sandiago21/speecht5_finetuned_google_fleurs_greek) checkpoint, which is based on Microsoft's
|
101 |
+
[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model and is fine-tuned in Greek Audio dataset
|
102 |
+
![Text-to-Speech (TTS)"](https://geekflare.com/wp-content/uploads/2021/07/texttospeech-1200x385.png "Diagram of Text-to-Speech (TTS)")
|
103 |
+
"""
|
104 |
+
|
105 |
+
|
106 |
def cleanup_text(text):
|
107 |
for src, dst in replacements:
|
108 |
text = text.replace(src, dst)
|
|
|
121 |
inputs = gr.Textbox(label="Text", placeholder="Type something here..."),
|
122 |
outputs=gr.Audio(),
|
123 |
examples=["Έλαβαν χώρα μεγάλες διαδηλώσεις στην Πολωνία όταν εκείνη η χώρα υπέγραψε την acta που οδήγησε την κυβέρνηση της πολωνίας να αποφασίσει τη μη επικύρωση της συμφωνίας προς το παρόν"],
|
124 |
+
title=title,
|
125 |
+
description=description,
|
126 |
).launch()
|