NikilDGr8 commited on
Commit
f736e15
·
verified ·
1 Parent(s): 4222cb7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -220,6 +220,13 @@ with gr.Blocks() as demo:
220
  audio_input = gr.Audio(type="filepath", label="Record your audio", elem_id="audio_input")
221
  transcribe_button = gr.Button("Transcribe and Generate Form", elem_id="transcribe_button", interactive=False)
222
 
 
 
 
 
 
 
 
223
  with gr.Row(elem_id="textboxes_row"):
224
  with gr.Column():
225
  doctor_name_display = gr.Textbox(label="Doctor’s Name", value="", interactive=False)
@@ -232,7 +239,7 @@ with gr.Blocks() as demo:
232
  textboxes_right.append(gr.Dropdown(choices=["NONE", "ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], value="NONE", label="Referred to", interactive=True))
233
  textboxes_right.append(gr.Dropdown(choices=["+", "++", "+++"], label="Calculus", interactive=True))
234
  textboxes_right.append(gr.Dropdown(choices=["-", "+", "++", "+++"], label="Stains", interactive=True))
235
- textboxes_right.append(gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy/RCT", "Extraction", "Medication", "Referral"], label="Treatment plan", interactive=True))
236
  oha_output = gr.Textbox(label="OHA Output", value="", interactive=False)
237
  save_button = gr.Button("Save to Supabase", elem_id="save_button", interactive=True)
238
  transcribe_button.click(fn=main, inputs=[audio_input, doctor_name_display, location_display], outputs=[oha_output])
 
220
  audio_input = gr.Audio(type="filepath", label="Record your audio", elem_id="audio_input")
221
  transcribe_button = gr.Button("Transcribe and Generate Form", elem_id="transcribe_button", interactive=False)
222
 
223
+ def enable_transcribe_button(audio):
224
+ if audio:
225
+ return gr.update(interactive=True)
226
+ return gr.update(interactive=False)
227
+
228
+ audio_input.change(fn=enable_transcribe_button, inputs=audio_input, outputs=transcribe_button)
229
+
230
  with gr.Row(elem_id="textboxes_row"):
231
  with gr.Column():
232
  doctor_name_display = gr.Textbox(label="Doctor’s Name", value="", interactive=False)
 
239
  textboxes_right.append(gr.Dropdown(choices=["NONE", "ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], value="NONE", label="Referred to", interactive=True))
240
  textboxes_right.append(gr.Dropdown(choices=["+", "++", "+++"], label="Calculus", interactive=True))
241
  textboxes_right.append(gr.Dropdown(choices=["-", "+", "++", "+++"], label="Stains", interactive=True))
242
+ textboxes_right.append(gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy/RCT", "Extraction", "Medication"], label="Treatment plan", interactive=True))
243
  oha_output = gr.Textbox(label="OHA Output", value="", interactive=False)
244
  save_button = gr.Button("Save to Supabase", elem_id="save_button", interactive=True)
245
  transcribe_button.click(fn=main, inputs=[audio_input, doctor_name_display, location_display], outputs=[oha_output])