Spaces:
Sleeping
Sleeping
farhananis005
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -681,7 +681,6 @@ def formatted_response(docs, question, response, state):
|
|
681 |
return state, state
|
682 |
|
683 |
"""# UI"""
|
684 |
-
|
685 |
import gradio as gr
|
686 |
|
687 |
css = """
|
@@ -775,7 +774,7 @@ with gr.Blocks(css=css) as demo:
|
|
775 |
doctor_recommendations_box_text
|
776 |
]
|
777 |
)
|
778 |
-
|
779 |
# Add Save Report Button
|
780 |
with gr.Row():
|
781 |
save_button = gr.Button("Save Report", variant="secondary")
|
@@ -803,8 +802,10 @@ with gr.Blocks(css=css) as demo:
|
|
803 |
with gr.Column():
|
804 |
# Chatbot for Q&A
|
805 |
soap_chatbot = gr.Chatbot(label="SOAP Chatbot")
|
806 |
-
soap_chat_input = gr.Textbox(
|
807 |
-
|
|
|
|
|
808 |
|
809 |
# Refresh button for SOAP file dropdown
|
810 |
soap_refresh_button.click(fn=soap_refresh, inputs=None, outputs=ask_soap_input)
|
@@ -812,6 +813,7 @@ with gr.Blocks(css=css) as demo:
|
|
812 |
# Display selected SOAP report content
|
813 |
ask_soap_input.change(fn=get_soap_report_content, inputs=ask_soap_input, outputs=soap_content_display)
|
814 |
|
|
|
815 |
# Handle chatbot input submission with streaming response
|
816 |
soap_chat_input.submit(
|
817 |
handle_chat_message,
|
@@ -832,8 +834,10 @@ with gr.Blocks(css=css) as demo:
|
|
832 |
with gr.Column():
|
833 |
# Chatbot for SBAR Q&A
|
834 |
sbar_chatbot = gr.Chatbot(label="SBAR Chatbot")
|
835 |
-
sbar_chat_input = gr.Textbox(
|
836 |
-
|
|
|
|
|
837 |
|
838 |
# Refresh button for SBAR file dropdown
|
839 |
sbar_refresh_button.click(fn=sbar_refresh, inputs=None, outputs=ask_sbar_input)
|
@@ -841,6 +845,7 @@ with gr.Blocks(css=css) as demo:
|
|
841 |
# Display selected SBAR report content
|
842 |
ask_sbar_input.change(fn=get_sbar_report_content, inputs=ask_sbar_input, outputs=sbar_content_display)
|
843 |
|
|
|
844 |
# Handle chatbot input submission with streaming response
|
845 |
sbar_chat_input.submit(
|
846 |
handle_chat_message,
|
@@ -905,4 +910,3 @@ with gr.Blocks(css=css) as demo:
|
|
905 |
docs2_delete_button.click(delete2_docs, inputs=None, outputs=docs2_delete_output)
|
906 |
|
907 |
demo.launch(debug=True)
|
908 |
-
|
|
|
681 |
return state, state
|
682 |
|
683 |
"""# UI"""
|
|
|
684 |
import gradio as gr
|
685 |
|
686 |
css = """
|
|
|
774 |
doctor_recommendations_box_text
|
775 |
]
|
776 |
)
|
777 |
+
|
778 |
# Add Save Report Button
|
779 |
with gr.Row():
|
780 |
save_button = gr.Button("Save Report", variant="secondary")
|
|
|
802 |
with gr.Column():
|
803 |
# Chatbot for Q&A
|
804 |
soap_chatbot = gr.Chatbot(label="SOAP Chatbot")
|
805 |
+
soap_chat_input = gr.Textbox(placeholder="Enter your question here...", submit_btn=True)
|
806 |
+
audio_file = gr.Audio(label="Audio Input", type="filepath",sources="microphone")
|
807 |
+
submit_audio_btn = gr.Button("Submit Audio")
|
808 |
+
clear = gr.ClearButton([soap_chat_input, soap_chatbot,audio_file])
|
809 |
|
810 |
# Refresh button for SOAP file dropdown
|
811 |
soap_refresh_button.click(fn=soap_refresh, inputs=None, outputs=ask_soap_input)
|
|
|
813 |
# Display selected SOAP report content
|
814 |
ask_soap_input.change(fn=get_soap_report_content, inputs=ask_soap_input, outputs=soap_content_display)
|
815 |
|
816 |
+
submit_audio_btn.click(openai_STT, inputs=audio_file, outputs=soap_chat_input)
|
817 |
# Handle chatbot input submission with streaming response
|
818 |
soap_chat_input.submit(
|
819 |
handle_chat_message,
|
|
|
834 |
with gr.Column():
|
835 |
# Chatbot for SBAR Q&A
|
836 |
sbar_chatbot = gr.Chatbot(label="SBAR Chatbot")
|
837 |
+
sbar_chat_input = gr.Textbox(placeholder="Enter your question here...",submit_btn=True)
|
838 |
+
audio_file = gr.Audio(label="Audio Input", type="filepath",sources="microphone")
|
839 |
+
submit_audio_btn = gr.Button("Submit Audio")
|
840 |
+
clear_sbar = gr.ClearButton([sbar_chat_input, sbar_chatbot,audio_file])
|
841 |
|
842 |
# Refresh button for SBAR file dropdown
|
843 |
sbar_refresh_button.click(fn=sbar_refresh, inputs=None, outputs=ask_sbar_input)
|
|
|
845 |
# Display selected SBAR report content
|
846 |
ask_sbar_input.change(fn=get_sbar_report_content, inputs=ask_sbar_input, outputs=sbar_content_display)
|
847 |
|
848 |
+
submit_audio_btn.click(openai_STT, inputs=audio_file, outputs=sbar_chat_input)
|
849 |
# Handle chatbot input submission with streaming response
|
850 |
sbar_chat_input.submit(
|
851 |
handle_chat_message,
|
|
|
910 |
docs2_delete_button.click(delete2_docs, inputs=None, outputs=docs2_delete_output)
|
911 |
|
912 |
demo.launch(debug=True)
|
|