Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
os.system("pip install gradio==2.8.0b")
|
| 3 |
import gradio as gr
|
|
|
|
| 4 |
|
| 5 |
title = "XM_Tranformer"
|
| 6 |
|
|
@@ -8,11 +9,11 @@ description = "Gradio Demo for fairseq S2T: Fast Speech-to-Text Modeling with fa
|
|
| 8 |
|
| 9 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2010.05171' target='_blank'>fairseq S2T: Fast Speech-to-Text Modeling with fairseq</a> | <a href='https://github.com/pytorch/fairseq/tree/main/examples/speech_to_text' target='_blank'>Github Repo</a></p>"
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
io1 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-es_en-multi_domain")
|
| 18 |
|
|
@@ -33,6 +34,7 @@ io8 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-en_tr-multi_do
|
|
| 33 |
|
| 34 |
|
| 35 |
def inference(text,model):
|
|
|
|
| 36 |
if model == "xm_transformer_600m-es_en-multi_domain":
|
| 37 |
outtext = io1(text)
|
| 38 |
elif model == "xm_transformer_600m-ru_en-multi_domain":
|
|
@@ -59,4 +61,5 @@ gr.Interface(
|
|
| 59 |
gr.outputs.Audio(label="Output"),
|
| 60 |
article=article,
|
| 61 |
title=title,
|
|
|
|
| 62 |
description=description).launch(enable_queue=True)
|
|
|
|
| 1 |
import os
|
| 2 |
os.system("pip install gradio==2.8.0b")
|
| 3 |
import gradio as gr
|
| 4 |
+
import numpy as np
|
| 5 |
|
| 6 |
title = "XM_Tranformer"
|
| 7 |
|
|
|
|
| 9 |
|
| 10 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2010.05171' target='_blank'>fairseq S2T: Fast Speech-to-Text Modeling with fairseq</a> | <a href='https://github.com/pytorch/fairseq/tree/main/examples/speech_to_text' target='_blank'>Github Repo</a></p>"
|
| 11 |
|
| 12 |
+
examples = [
|
| 13 |
+
["common_voice_es_en.flac","xm_transformer_600m-es_en-multi_domain"],
|
| 14 |
+
["common_voice_ru_18945535.flac","xm_transformer_600m-ru_en-multi_domain"],
|
| 15 |
+
["common_voice_fr_19731305.mp3","xm_transformer_600m-fr_en-multi_domain"]
|
| 16 |
+
]
|
| 17 |
|
| 18 |
io1 = gr.Interface.load("huggingface/facebook/xm_transformer_600m-es_en-multi_domain")
|
| 19 |
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
def inference(text,model):
|
| 37 |
+
outtext = np.empty()
|
| 38 |
if model == "xm_transformer_600m-es_en-multi_domain":
|
| 39 |
outtext = io1(text)
|
| 40 |
elif model == "xm_transformer_600m-ru_en-multi_domain":
|
|
|
|
| 61 |
gr.outputs.Audio(label="Output"),
|
| 62 |
article=article,
|
| 63 |
title=title,
|
| 64 |
+
examples=examples,
|
| 65 |
description=description).launch(enable_queue=True)
|