Spaces:
Runtime error
Runtime error
tonic
commited on
Commit
·
b958361
1
Parent(s):
d886b33
fix gradio
Browse files
app.py
CHANGED
|
@@ -251,28 +251,28 @@ def process_input(image=None, file=None, audio=None, text="", translateto = "Eng
|
|
| 251 |
|
| 252 |
# Define the inputs and outputs for the Gradio Interface
|
| 253 |
inputs = [
|
| 254 |
-
gr.
|
| 255 |
-
gr.
|
| 256 |
-
gr.
|
| 257 |
-
gr.
|
| 258 |
-
gr.
|
| 259 |
-
gr.
|
| 260 |
]
|
| 261 |
|
| 262 |
outputs = [
|
| 263 |
RichTextbox(label="Processed Text"),
|
| 264 |
-
gr.
|
| 265 |
-
gr.
|
| 266 |
-
gr.
|
| 267 |
-
gr.
|
| 268 |
-
gr.
|
| 269 |
-
gr.
|
| 270 |
-
gr.
|
| 271 |
-
gr.
|
| 272 |
-
gr.
|
| 273 |
-
gr.
|
| 274 |
-
gr.
|
| 275 |
-
gr.
|
| 276 |
]
|
| 277 |
def update_outputs(image, file, audio, text, input_language, target_language):
|
| 278 |
final_text, top_phrases, translations, audio_outputs = process_input(
|
|
|
|
| 251 |
|
| 252 |
# Define the inputs and outputs for the Gradio Interface
|
| 253 |
inputs = [
|
| 254 |
+
gr.Image(type="pil", label="Camera Input"),
|
| 255 |
+
gr.File(label="File Upload"),
|
| 256 |
+
gr.Audio(sources="microphone", type="filepath", label="Mic Input"),
|
| 257 |
+
gr.Textbox(lines=2, label="Text Input"),
|
| 258 |
+
gr.Dropdown(choices=choices, label="Your Native Language"),
|
| 259 |
+
gr.Dropdown(choices=choices, label="Language To Learn")
|
| 260 |
]
|
| 261 |
|
| 262 |
outputs = [
|
| 263 |
RichTextbox(label="Processed Text"),
|
| 264 |
+
gr.Audio(label="Audio Output (Native Language) 1"),
|
| 265 |
+
gr.Audio(label="Audio Output (Target Language) 1"),
|
| 266 |
+
gr.Audio(label="Audio Output (Native Language) 2"),
|
| 267 |
+
gr.Audio(label="Audio Output (Target Language) 2"),
|
| 268 |
+
gr.Audio(label="Audio Output (Native Language) 3"),
|
| 269 |
+
gr.Audio(label="Audio Output (Target Language) 3"),
|
| 270 |
+
gr.Textbox(label="Focus 1"),
|
| 271 |
+
gr.Textbox(label="Translated Phrases 1"),
|
| 272 |
+
gr.Textbox(label="Focus 2"),
|
| 273 |
+
gr.Textbox(label="Translated Phrases 2"),
|
| 274 |
+
gr.Textbox(label="Focus 3"),
|
| 275 |
+
gr.Textbox(label="Translated Phrases 3")
|
| 276 |
]
|
| 277 |
def update_outputs(image, file, audio, text, input_language, target_language):
|
| 278 |
final_text, top_phrases, translations, audio_outputs = process_input(
|