Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -574,12 +574,14 @@ languages = [
|
|
| 574 |
|
| 575 |
def clear(input_language, audio_input, image_input, text_input):
|
| 576 |
# Reset each input to its default state
|
| 577 |
-
return "", None, None, "", []
|
| 578 |
|
| 579 |
|
| 580 |
def create_interface():
|
| 581 |
with gr.Blocks(theme='ParityError/Anime') as iface:
|
| 582 |
-
|
|
|
|
|
|
|
| 583 |
|
| 584 |
with gr.Accordion("Use Voice", open=False) as voice_accordion:
|
| 585 |
audio_input = gr.Audio(label="Speak", type="filepath", sources="microphone", optional=True)
|
|
@@ -593,13 +595,11 @@ def create_interface():
|
|
| 593 |
text_input = gr.Textbox(label="Use Text", lines=5, optional=True)
|
| 594 |
text_output = gr.Markdown(label="Output text")
|
| 595 |
|
| 596 |
-
# Moved the MultiMed button outside of the accordion
|
| 597 |
text_button = gr.Button("Use MultiMed")
|
| 598 |
hallucination_output = gr.Label(label="Hallucination Evaluation")
|
| 599 |
text_button.click(process_and_query, inputs=[input_language, audio_input, image_input, text_input], outputs=[text_output, hallucination_output])
|
| 600 |
|
| 601 |
clear_button = gr.Button("Clear")
|
| 602 |
-
# Link the clear function to the clear button
|
| 603 |
clear_button.click(clear, inputs=[input_language, audio_input, image_input, text_input], outputs=[input_language, audio_input, image_input, text_input, voice_accordion, picture_accordion, multimend_accordion])
|
| 604 |
|
| 605 |
return iface
|
|
|
|
| 574 |
|
| 575 |
def clear(input_language, audio_input, image_input, text_input):
|
| 576 |
# Reset each input to its default state
|
| 577 |
+
return "None", None, None, "", []
|
| 578 |
|
| 579 |
|
| 580 |
def create_interface():
|
| 581 |
with gr.Blocks(theme='ParityError/Anime') as iface:
|
| 582 |
+
# Add a 'None' or similar option to represent no selection
|
| 583 |
+
input_language_options = ["None"] + languages
|
| 584 |
+
input_language = gr.Dropdown(input_language_options, label="Select the language", value="None", interactive=True)
|
| 585 |
|
| 586 |
with gr.Accordion("Use Voice", open=False) as voice_accordion:
|
| 587 |
audio_input = gr.Audio(label="Speak", type="filepath", sources="microphone", optional=True)
|
|
|
|
| 595 |
text_input = gr.Textbox(label="Use Text", lines=5, optional=True)
|
| 596 |
text_output = gr.Markdown(label="Output text")
|
| 597 |
|
|
|
|
| 598 |
text_button = gr.Button("Use MultiMed")
|
| 599 |
hallucination_output = gr.Label(label="Hallucination Evaluation")
|
| 600 |
text_button.click(process_and_query, inputs=[input_language, audio_input, image_input, text_input], outputs=[text_output, hallucination_output])
|
| 601 |
|
| 602 |
clear_button = gr.Button("Clear")
|
|
|
|
| 603 |
clear_button.click(clear, inputs=[input_language, audio_input, image_input, text_input], outputs=[input_language, audio_input, image_input, text_input, voice_accordion, picture_accordion, multimend_accordion])
|
| 604 |
|
| 605 |
return iface
|