Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,15 +3,15 @@ import torch
|
|
3 |
from datasets import load_dataset
|
4 |
from transformers import pipeline, SpeechT5Processor, SpeechT5HifiGan, SpeechT5ForTextToSpeech
|
5 |
|
6 |
-
model_id = "gitgato/tr-
|
7 |
-
|
8 |
model = SpeechT5ForTextToSpeech.from_pretrained(model_id)
|
9 |
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 =
|
15 |
|
16 |
replacements = [
|
17 |
("à", "a"),
|
@@ -30,7 +30,7 @@ replacements = [
|
|
30 |
|
31 |
title = "Text-to-Speech"
|
32 |
description = """
|
33 |
-
Demo for text-to-speech translation in French. Demo uses [
|
34 |
[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model and is fine-tuned in French Audio dataset
|
35 |
![Text-to-Speech (TTS)"](https://geekflare.com/wp-content/uploads/2021/07/texttospeech-1200x385.png "Diagram of Text-to-Speech (TTS)")
|
36 |
"""
|
@@ -53,9 +53,7 @@ syntesize_speech_gradio = gr.Interface(
|
|
53 |
synthesize_speech,
|
54 |
inputs = gr.Textbox(label="Text", placeholder="Type something here..."),
|
55 |
outputs=gr.Audio(),
|
56 |
-
examples=["
|
57 |
title=title,
|
58 |
description=description,
|
59 |
-
).launch()
|
60 |
-
|
61 |
-
|
|
|
3 |
from datasets import load_dataset
|
4 |
from transformers import pipeline, SpeechT5Processor, SpeechT5HifiGan, SpeechT5ForTextToSpeech
|
5 |
|
6 |
+
model_id = "gitgato/tr-tts" # update with your model id
|
7 |
+
pipe = pipeline("text-to-speech", model="gitgato/tr-xtts")
|
8 |
model = SpeechT5ForTextToSpeech.from_pretrained(model_id)
|
9 |
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 = AutoProcessor.from_pretrained("gitgato/tr-xtts")
|
15 |
|
16 |
replacements = [
|
17 |
("à", "a"),
|
|
|
30 |
|
31 |
title = "Text-to-Speech"
|
32 |
description = """
|
33 |
+
Demo for text-to-speech translation in French. Demo uses [gitgato/trtts](https://huggingface.co) checkpoint, which is based on Microsoft's
|
34 |
[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model and is fine-tuned in French Audio dataset
|
35 |
![Text-to-Speech (TTS)"](https://geekflare.com/wp-content/uploads/2021/07/texttospeech-1200x385.png "Diagram of Text-to-Speech (TTS)")
|
36 |
"""
|
|
|
53 |
synthesize_speech,
|
54 |
inputs = gr.Textbox(label="Text", placeholder="Type something here..."),
|
55 |
outputs=gr.Audio(),
|
56 |
+
examples=["Je n'entrerai pas dans les détails, mais je profiterai des secondes qui me restent pour exposer la position ALDE sur le marquage CE, un des points cruciaux de ce rapport."],
|
57 |
title=title,
|
58 |
description=description,
|
59 |
+
).launch()
|
|
|
|