Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -159,33 +159,34 @@ def gradio_download():
|
|
159 |
with gr.Blocks() as demo:
|
160 |
gr.Markdown("# OHA Form Filler App")
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
with gr.Page(title="OHA Form"):
|
169 |
-
audio_input = gr.Audio(type="filepath", label="Record your audio", elem_id="audio_input")
|
170 |
-
transcribe_button = gr.Button("Transcribe and Generate Form", elem_id="transcribe_button")
|
171 |
-
|
172 |
-
with gr.Row(elem_id="textboxes_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 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
# Launch the app
|
191 |
demo.launch()
|
|
|
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", elem_id="audio_input")
|
170 |
+
transcribe_button = gr.Button("Transcribe and Generate Form", elem_id="transcribe_button")
|
171 |
+
|
172 |
+
with gr.Row(elem_id="textboxes_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", elem_id="submit_button")
|
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)
|
183 |
+
submit_button.click(fn=save_answers, inputs=textboxes_left + textboxes_right + [dropdown_referred], outputs=output_html)
|
184 |
+
|
185 |
+
with gr.TabItem("Download"):
|
186 |
+
download_button = gr.Button("Download Table as CSV")
|
187 |
+
download_csv_output = gr.File(label="Download CSV")
|
188 |
+
|
189 |
+
download_button.click(fn=gradio_download, inputs=[], outputs=download_csv_output)
|
190 |
|
191 |
# Launch the app
|
192 |
demo.launch()
|