make share button visible when ready
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def infer(audio):
|
|
21 |
#portrait_response = requests.get(portrait_link, headers={'Authorization': 'Bearer ' + token})
|
22 |
#print(portrait_response.text)
|
23 |
|
24 |
-
return whisper_to_gpt_response[0], portrait_link, gr.update(visible=True)
|
25 |
|
26 |
title = """
|
27 |
<div style="text-align: center; max-width: 500px; margin: 0 auto;">
|
@@ -59,12 +59,12 @@ with gr.Blocks(css="style.css") as demo:
|
|
59 |
|
60 |
send_btn = gr.Button("Send my request !")
|
61 |
|
62 |
-
with gr.Group(elem_id="share-btn-container"):
|
63 |
-
community_icon = gr.HTML(community_icon_html
|
64 |
-
loading_icon = gr.HTML(loading_icon_html
|
65 |
-
share_button = gr.Button("Share to community", elem_id="share-btn"
|
66 |
|
67 |
-
send_btn.click(infer, inputs=[record_input], outputs=[whisper_tr, gpt_response,
|
68 |
share_button.click(None, [], [], _js=share_js)
|
69 |
|
70 |
demo.queue(max_size=32, concurrency_count=20).launch(debug=True)
|
|
|
21 |
#portrait_response = requests.get(portrait_link, headers={'Authorization': 'Bearer ' + token})
|
22 |
#print(portrait_response.text)
|
23 |
|
24 |
+
return whisper_to_gpt_response[0], portrait_link, gr.update(visible=True)
|
25 |
|
26 |
title = """
|
27 |
<div style="text-align: center; max-width: 500px; margin: 0 auto;">
|
|
|
59 |
|
60 |
send_btn = gr.Button("Send my request !")
|
61 |
|
62 |
+
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
63 |
+
community_icon = gr.HTML(community_icon_html)
|
64 |
+
loading_icon = gr.HTML(loading_icon_html)
|
65 |
+
share_button = gr.Button("Share to community", elem_id="share-btn")
|
66 |
|
67 |
+
send_btn.click(infer, inputs=[record_input], outputs=[whisper_tr, gpt_response, share_group])
|
68 |
share_button.click(None, [], [], _js=share_js)
|
69 |
|
70 |
demo.queue(max_size=32, concurrency_count=20).launch(debug=True)
|