Commit
·
748ad62
1
Parent(s):
ee3d3d0
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
-
from datasets import load_dataset
|
5 |
from transformers import VitsModel, VitsTokenizer, pipeline
|
6 |
|
7 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
@@ -33,7 +32,7 @@ def speech_to_speech_translation(audio):
|
|
33 |
return 16000, synthesised_speech
|
34 |
|
35 |
|
36 |
-
|
37 |
# description = """
|
38 |
# Demo for cascaded speech-to-speech translation (STST), mapping from source speech in any language to target speech in French. Demo uses OpenAI's [Whisper Base](https://huggingface.co/openai/whisper-base) model for speech translation, and Facebook's
|
39 |
# [MMS TTS](https://huggingface.co/facebook/mms-tts) model for text-to-speech:
|
@@ -47,7 +46,7 @@ mic_translate = gr.Interface(
|
|
47 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
48 |
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
49 |
title=title,
|
50 |
-
description=description,
|
51 |
)
|
52 |
|
53 |
file_translate = gr.Interface(
|
@@ -56,7 +55,7 @@ file_translate = gr.Interface(
|
|
56 |
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
57 |
examples=[["./example.wav"]],
|
58 |
title=title,
|
59 |
-
description=description,
|
60 |
)
|
61 |
|
62 |
with demo:
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import torch
|
|
|
4 |
from transformers import VitsModel, VitsTokenizer, pipeline
|
5 |
|
6 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
|
|
32 |
return 16000, synthesised_speech
|
33 |
|
34 |
|
35 |
+
title = "Cascaded STST"
|
36 |
# description = """
|
37 |
# Demo for cascaded speech-to-speech translation (STST), mapping from source speech in any language to target speech in French. Demo uses OpenAI's [Whisper Base](https://huggingface.co/openai/whisper-base) model for speech translation, and Facebook's
|
38 |
# [MMS TTS](https://huggingface.co/facebook/mms-tts) model for text-to-speech:
|
|
|
46 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
47 |
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
48 |
title=title,
|
49 |
+
#description=description,
|
50 |
)
|
51 |
|
52 |
file_translate = gr.Interface(
|
|
|
55 |
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
56 |
examples=[["./example.wav"]],
|
57 |
title=title,
|
58 |
+
#description=description,
|
59 |
)
|
60 |
|
61 |
with demo:
|