tonic commited on
Commit
b958361
1 Parent(s): d886b33

fix gradio

Browse files
Files changed (1) hide show
  1. app.py +18 -18
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.inputs.Image(type="pil", label="Camera Input"),
255
- gr.inputs.File(label="File Upload"),
256
- gr.inputs.Audio(sources="microphone", type="filepath", label="Mic Input"),
257
- gr.inputs.Textbox(lines=2, label="Text Input"),
258
- gr.inputs.Dropdown(choices=choices, label="Your Native Language"),
259
- gr.inputs.Dropdown(choices=choices, label="Language To Learn")
260
  ]
261
 
262
  outputs = [
263
  RichTextbox(label="Processed Text"),
264
- gr.outputs.Audio(label="Audio Output (Native Language) 1"),
265
- gr.outputs.Audio(label="Audio Output (Target Language) 1"),
266
- gr.outputs.Audio(label="Audio Output (Native Language) 2"),
267
- gr.outputs.Audio(label="Audio Output (Target Language) 2"),
268
- gr.outputs.Audio(label="Audio Output (Native Language) 3"),
269
- gr.outputs.Audio(label="Audio Output (Target Language) 3"),
270
- gr.outputs.Textbox(label="Focus 1"),
271
- gr.outputs.Textbox(label="Translated Phrases 1"),
272
- gr.outputs.Textbox(label="Focus 2"),
273
- gr.outputs.Textbox(label="Translated Phrases 2"),
274
- gr.outputs.Textbox(label="Focus 3"),
275
- gr.outputs.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(
 
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(