Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -564,24 +564,25 @@ def clear():
|
|
| 564 |
|
| 565 |
def create_interface():
|
| 566 |
with gr.Blocks(theme='ParityError/Anime') as iface:
|
|
|
|
|
|
|
| 567 |
# Add a 'None' or similar option to represent no selection
|
| 568 |
input_language_options = ["None"] + languages
|
| 569 |
-
input_language = gr.Dropdown(input_language_options, label="Select the language", value="
|
| 570 |
|
| 571 |
with gr.Accordion("Use Voice", open=False) as voice_accordion:
|
| 572 |
-
audio_input = gr.Audio(label="Speak", type="filepath", sources="microphone")
|
| 573 |
audio_output = gr.Markdown(label="Output text") # Markdown component for audio
|
| 574 |
|
| 575 |
with gr.Accordion("Use a Picture", open=False) as picture_accordion:
|
| 576 |
-
image_input = gr.Image(label="Upload image")
|
| 577 |
image_output = gr.Markdown(label="Output text") # Markdown component for image
|
| 578 |
|
| 579 |
with gr.Accordion("MultiMed", open=False) as multimend_accordion:
|
| 580 |
-
text_input = gr.Textbox(label="Use Text", lines=3)
|
| 581 |
text_output = gr.Markdown(label="Output text") # Markdown component for text
|
| 582 |
|
| 583 |
text_button = gr.Button("Use MultiMed")
|
| 584 |
-
hallucination_output = gr.Label(label="Hallucination Evaluation")
|
| 585 |
text_button.click(process_and_query, inputs=[input_language, audio_input, image_input, text_input], outputs=[text_output, hallucination_output])
|
| 586 |
|
| 587 |
clear_button = gr.Button("Clear")
|
|
@@ -590,4 +591,4 @@ def create_interface():
|
|
| 590 |
return iface
|
| 591 |
|
| 592 |
iface = create_interface()
|
| 593 |
-
iface.launch(show_error=True, debug=True
|
|
|
|
| 564 |
|
| 565 |
def create_interface():
|
| 566 |
with gr.Blocks(theme='ParityError/Anime') as iface:
|
| 567 |
+
# Display the welcome message
|
| 568 |
+
gr.Markdown(welcome_message)
|
| 569 |
# Add a 'None' or similar option to represent no selection
|
| 570 |
input_language_options = ["None"] + languages
|
| 571 |
+
input_language = gr.Dropdown(input_language_options, label="Select the language", value="English", interactive=True)
|
| 572 |
|
| 573 |
with gr.Accordion("Use Voice", open=False) as voice_accordion:
|
| 574 |
+
audio_input = gr.Audio(label="Speak", type="filepath", sources="microphone", examples=["audio1.wav", "audio2.mp3"])
|
| 575 |
audio_output = gr.Markdown(label="Output text") # Markdown component for audio
|
| 576 |
|
| 577 |
with gr.Accordion("Use a Picture", open=False) as picture_accordion:
|
| 578 |
+
image_input = gr.Image(label="Upload image"examples=["image1.jpg", "image2.png", "image3.jpg"])
|
| 579 |
image_output = gr.Markdown(label="Output text") # Markdown component for image
|
| 580 |
|
| 581 |
with gr.Accordion("MultiMed", open=False) as multimend_accordion:
|
| 582 |
+
text_input = gr.Textbox(label="Use Text", lines=3, placeholder="I have had a sore throat and phlegm for a few days and now my cough has gotten worse!")
|
| 583 |
text_output = gr.Markdown(label="Output text") # Markdown component for text
|
| 584 |
|
| 585 |
text_button = gr.Button("Use MultiMed")
|
|
|
|
| 586 |
text_button.click(process_and_query, inputs=[input_language, audio_input, image_input, text_input], outputs=[text_output, hallucination_output])
|
| 587 |
|
| 588 |
clear_button = gr.Button("Clear")
|
|
|
|
| 591 |
return iface
|
| 592 |
|
| 593 |
iface = create_interface()
|
| 594 |
+
iface.launch(show_error=True, debug=True)
|