fffiloni commited on
Commit
fa65db5
·
1 Parent(s): 7059226

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -82,7 +82,7 @@ def call_api(message, openai_api_key):
82
  return str(response.choices[0].text).split("\n",2)[2]
83
 
84
  def clean_components():
85
- return gr.HTML.update(visible=False), gr.Textbox(visible=False)
86
 
87
  title = """
88
  <div style="text-align: center; max-width: 500px; margin: 0 auto;">
@@ -129,7 +129,7 @@ with gr.Blocks(css="style.css") as demo:
129
  clean_btn = gr.Button("Clean")
130
  send_btn = gr.Button("Send my request !")
131
 
132
- clean_btn.click(clean_components, inputs=[], outputs=[error_handler, whisper_tr])
133
  send_btn.click(infer, inputs=[record_input, openai_api_key], outputs=[whisper_tr, gpt_response, error_handler, share_group])
134
  share_button.click(None, [], [], _js=share_js)
135
 
 
82
  return str(response.choices[0].text).split("\n",2)[2]
83
 
84
  def clean_components():
85
+ return gr.Audio(source="microphone",type="filepath", label="Audio input", show_label=True, elem_id="record_btn"), gr.HTML.update(visible=False), gr.Textbox.update(visible=False), gr.Button(visible=False)
86
 
87
  title = """
88
  <div style="text-align: center; max-width: 500px; margin: 0 auto;">
 
129
  clean_btn = gr.Button("Clean")
130
  send_btn = gr.Button("Send my request !")
131
 
132
+ clean_btn.click(clean_components, inputs=[], outputs=[record_input, error_handler, whisper_tr, clean_btn])
133
  send_btn.click(infer, inputs=[record_input, openai_api_key], outputs=[whisper_tr, gpt_response, error_handler, share_group])
134
  share_button.click(None, [], [], _js=share_js)
135