Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -195,40 +195,42 @@ def yt_transcribe(yt_url, task, max_filesize=75.0):
|
|
195 |
# Interfaces
|
196 |
demo = gr.Blocks()
|
197 |
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
)
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
|
|
229 |
|
230 |
with demo:
|
231 |
gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
|
232 |
|
233 |
-
demo.launch()
|
234 |
|
|
|
|
195 |
# Interfaces
|
196 |
demo = gr.Blocks()
|
197 |
|
198 |
+
mf_transcribe = gr.Interface(
|
199 |
+
fn=gradio_interface,
|
200 |
+
inputs=[
|
201 |
+
gr.Audio(sources=["microphone"], type="filepath"),
|
202 |
+
gr.Dropdown(lang_codes, value='French', label='Source Language'),
|
203 |
+
gr.Dropdown(lang_codes, value='English', label='Target Language')
|
204 |
+
],
|
205 |
+
outputs=[
|
206 |
+
gr.Textbox(label="Transcribed Text"),
|
207 |
+
gr.Textbox(label="Translated Text")]
|
208 |
+
)
|
209 |
+
|
210 |
+
file_transcribe = gr.Interface(
|
211 |
+
fn=gradio_interface,
|
212 |
+
inputs=[
|
213 |
+
gr.Audio(type="filepath", label="Audio file"),
|
214 |
+
gr.Dropdown(lang_codes, value='French', label='Source Language'),
|
215 |
+
gr.Dropdown(lang_codes, value='English', label='Target Language')
|
216 |
+
],
|
217 |
+
outputs=[
|
218 |
+
gr.Textbox(label="Transcribed Text"),
|
219 |
+
gr.Textbox(label="Translated Text")]
|
220 |
+
)
|
221 |
+
|
222 |
+
yt_transcribe = gr.Interface(
|
223 |
+
fn=yt_transcribe,
|
224 |
+
inputs=[
|
225 |
+
gr.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
|
226 |
+
gr.Dropdown(lang_codes, value='French', label='Source Language'),
|
227 |
+
gr.Dropdown(lang_codes, value='English', label='Target Language')
|
228 |
+
],
|
229 |
+
outputs=["html", gr.Textbox(label="Transcribed Text"), gr.Textbox(label="Translated Text")]
|
230 |
+
)
|
231 |
|
232 |
with demo:
|
233 |
gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
|
234 |
|
|
|
235 |
|
236 |
+
demo.launch()
|