Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -53,40 +53,40 @@ examples = [
|
|
53 |
import gradio as gr
|
54 |
demo = gr.Blocks()
|
55 |
|
56 |
-
Muti_translate=gr.Interface(
|
57 |
-
fn=speech_to_speech_translation_fix,
|
58 |
-
inputs=[
|
59 |
-
gr.Audio(label="Upload Speech", source="upload", type="filepath"),
|
60 |
-
gr.Audio(label="Record Speech", source="microphone", type="filepath"),
|
61 |
-
],
|
62 |
-
outputs=[
|
63 |
-
gr.Audio(label="Generated Speech", type="numpy"),
|
64 |
-
gr.Text(label="Transcription"),
|
65 |
-
],
|
66 |
-
title=title,
|
67 |
-
description=description,
|
68 |
-
examples=examples,
|
69 |
-
)
|
70 |
-
|
71 |
-
# mic_translate = gr.Interface(
|
72 |
# fn=speech_to_speech_translation_fix,
|
73 |
-
# inputs=
|
74 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
# title=title,
|
76 |
# description=description,
|
77 |
-
# )
|
78 |
-
|
79 |
-
# file_translate = gr.Interface(
|
80 |
-
# fn=speech_to_speech_translation_fix,
|
81 |
-
# inputs=gr.Audio(source="upload", type="filepath"),
|
82 |
-
# outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
83 |
# examples=examples,
|
84 |
-
# title=title,
|
85 |
-
# description=description,
|
86 |
# )
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
with demo:
|
89 |
-
|
90 |
-
gr.TabbedInterface([Muti_translate], ["Record or upload your speech"])
|
91 |
|
92 |
demo.launch(share=True)
|
|
|
53 |
import gradio as gr
|
54 |
demo = gr.Blocks()
|
55 |
|
56 |
+
# Muti_translate=gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
# fn=speech_to_speech_translation_fix,
|
58 |
+
# inputs=[
|
59 |
+
# gr.Audio(label="Upload Speech", source="upload", type="filepath"),
|
60 |
+
# gr.Audio(label="Record Speech", source="microphone", type="filepath"),
|
61 |
+
# ],
|
62 |
+
# outputs=[
|
63 |
+
# gr.Audio(label="Generated Speech", type="numpy"),
|
64 |
+
# gr.Text(label="Transcription"),
|
65 |
+
# ],
|
66 |
# title=title,
|
67 |
# description=description,
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
# examples=examples,
|
|
|
|
|
69 |
# )
|
70 |
|
71 |
+
mic_translate = gr.Interface(
|
72 |
+
fn=speech_to_speech_translation_fix,
|
73 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
74 |
+
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
75 |
+
title=title,
|
76 |
+
description=description,
|
77 |
+
)
|
78 |
+
|
79 |
+
file_translate = gr.Interface(
|
80 |
+
fn=speech_to_speech_translation_fix,
|
81 |
+
inputs=gr.Audio(source="upload", type="filepath"),
|
82 |
+
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
83 |
+
examples=examples,
|
84 |
+
title=title,
|
85 |
+
description=description,
|
86 |
+
)
|
87 |
+
|
88 |
with demo:
|
89 |
+
gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
|
90 |
+
#gr.TabbedInterface([Muti_translate], ["Record or upload your speech"])
|
91 |
|
92 |
demo.launch(share=True)
|