Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -159,24 +159,24 @@ def gradio_download():
|
|
159 |
with gr.Blocks() as demo:
|
160 |
gr.Markdown("# OHA Form Filler App")
|
161 |
|
162 |
-
with gr.Tabs():
|
163 |
with gr.TabItem("Doctor Info"):
|
164 |
doctor_name_input = gr.Textbox(label="Doctor's Name", interactive=True)
|
165 |
location_input = gr.Textbox(label="Location", interactive=True)
|
166 |
-
next_button = gr.Button("Next"
|
167 |
|
168 |
with gr.TabItem("OHA Form"):
|
169 |
-
audio_input = gr.Audio(type="filepath", label="Record your audio"
|
170 |
-
transcribe_button = gr.Button("Transcribe and Generate Form"
|
171 |
|
172 |
-
with gr.Row(
|
173 |
with gr.Column():
|
174 |
textboxes_left = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(2, len(oral_health_assessment_form)//2)]
|
175 |
with gr.Column():
|
176 |
textboxes_right = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(len(oral_health_assessment_form)//2, len(oral_health_assessment_form)-1)]
|
177 |
dropdown_referred = gr.Dropdown(choices=["NONE","ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], label="Referred to", interactive=True)
|
178 |
|
179 |
-
submit_button = gr.Button("Submit"
|
180 |
output_html = gr.HTML(label="Submitted Answers")
|
181 |
|
182 |
transcribe_button.click(fn=main, inputs=[audio_input, doctor_name_input, location_input], outputs=textboxes_left + textboxes_right)
|
@@ -188,7 +188,7 @@ with gr.Blocks() as demo:
|
|
188 |
|
189 |
download_button.click(fn=gradio_download, inputs=[], outputs=download_csv_output)
|
190 |
|
191 |
-
next_button.click(
|
192 |
|
193 |
# Launch the app
|
194 |
demo.launch()
|
|
|
159 |
with gr.Blocks() as demo:
|
160 |
gr.Markdown("# OHA Form Filler App")
|
161 |
|
162 |
+
with gr.Tabs() as tabs:
|
163 |
with gr.TabItem("Doctor Info"):
|
164 |
doctor_name_input = gr.Textbox(label="Doctor's Name", interactive=True)
|
165 |
location_input = gr.Textbox(label="Location", interactive=True)
|
166 |
+
next_button = gr.Button("Next")
|
167 |
|
168 |
with gr.TabItem("OHA Form"):
|
169 |
+
audio_input = gr.Audio(type="filepath", label="Record your audio")
|
170 |
+
transcribe_button = gr.Button("Transcribe and Generate Form")
|
171 |
|
172 |
+
with gr.Row():
|
173 |
with gr.Column():
|
174 |
textboxes_left = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(2, len(oral_health_assessment_form)//2)]
|
175 |
with gr.Column():
|
176 |
textboxes_right = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(len(oral_health_assessment_form)//2, len(oral_health_assessment_form)-1)]
|
177 |
dropdown_referred = gr.Dropdown(choices=["NONE","ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], label="Referred to", interactive=True)
|
178 |
|
179 |
+
submit_button = gr.Button("Submit")
|
180 |
output_html = gr.HTML(label="Submitted Answers")
|
181 |
|
182 |
transcribe_button.click(fn=main, inputs=[audio_input, doctor_name_input, location_input], outputs=textboxes_left + textboxes_right)
|
|
|
188 |
|
189 |
download_button.click(fn=gradio_download, inputs=[], outputs=download_csv_output)
|
190 |
|
191 |
+
next_button.click(fn=lambda: gr.set_active(tabs, 1), inputs=[], outputs=[])
|
192 |
|
193 |
# Launch the app
|
194 |
demo.launch()
|