fffiloni commited on
Commit
f92ecbc
·
1 Parent(s): 4149648

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -28,7 +28,7 @@ def infer(audio, openai_api_key):
28
 
29
  portrait_link = talking_face("wise_woman_portrait.png", audio_response, fn_index=0)
30
 
31
- return whisper_result, portrait_link, gr.Textbox.update(value=gpt_response[1], visible=True), gr.update(visible=True)
32
 
33
  def try_api(message, openai_api_key):
34
  try:
@@ -109,21 +109,20 @@ with gr.Blocks(css="style.css") as demo:
109
  gr.HTML(title)
110
 
111
  gpt_response = gr.Video(label="Talking Portrait response", elem_id="video_out")
 
 
 
 
112
  error_handler = gr.Textbox(visible=False, show_label=False)
113
 
114
  with gr.Column(elem_id="col-container-2"):
115
  with gr.Row():
116
  record_input = gr.Audio(source="microphone",type="filepath", label="Audio input", show_label=True, elem_id="record_btn")
117
  openai_api_key = gr.Textbox(max_lines=1, type="password", label="Your OpenAI API Key", placeholder="sk-123abc...")
118
- whisper_tr = gr.Textbox(label="whisper english translation", elem_id="text_inp")
119
 
120
  send_btn = gr.Button("Send my request !")
121
-
122
- with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
123
- community_icon = gr.HTML(community_icon_html)
124
- loading_icon = gr.HTML(loading_icon_html)
125
- share_button = gr.Button("Share to community", elem_id="share-btn")
126
-
127
  send_btn.click(infer, inputs=[record_input, openai_api_key], outputs=[whisper_tr, gpt_response, error_handler, share_group])
128
  share_button.click(None, [], [], _js=share_js)
129
 
 
28
 
29
  portrait_link = talking_face("wise_woman_portrait.png", audio_response, fn_index=0)
30
 
31
+ return gr.Textbox.update(value=whisper_result, visible=True), portrait_link, gr.Textbox.update(value=gpt_response[1], visible=True), gr.update(visible=True)
32
 
33
  def try_api(message, openai_api_key):
34
  try:
 
109
  gr.HTML(title)
110
 
111
  gpt_response = gr.Video(label="Talking Portrait response", elem_id="video_out")
112
+ with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
113
+ community_icon = gr.HTML(community_icon_html)
114
+ loading_icon = gr.HTML(loading_icon_html)
115
+ share_button = gr.Button("Share to community", elem_id="share-btn")
116
  error_handler = gr.Textbox(visible=False, show_label=False)
117
 
118
  with gr.Column(elem_id="col-container-2"):
119
  with gr.Row():
120
  record_input = gr.Audio(source="microphone",type="filepath", label="Audio input", show_label=True, elem_id="record_btn")
121
  openai_api_key = gr.Textbox(max_lines=1, type="password", label="Your OpenAI API Key", placeholder="sk-123abc...")
122
+ whisper_tr = gr.Textbox(label="whisper english translation", elem_id="text_inp", visible=False)
123
 
124
  send_btn = gr.Button("Send my request !")
125
+
 
 
 
 
 
126
  send_btn.click(infer, inputs=[record_input, openai_api_key], outputs=[whisper_tr, gpt_response, error_handler, share_group])
127
  share_button.click(None, [], [], _js=share_js)
128