Spaces:
Build error
Build error
Alex Volkov
commited on
Commit
·
fa979ce
1
Parent(s):
fed3bd3
again, FU gradio
Browse files- utils/apis.py +3 -2
utils/apis.py
CHANGED
@@ -48,7 +48,7 @@ def remote_download(url):
|
|
48 |
print(final_response)
|
49 |
if 'sub_video' in response:
|
50 |
subbed_video_media = response['sub_video']
|
51 |
-
return subbed_video_media, final_response, whisper_result
|
52 |
|
53 |
def test_api(url=''):
|
54 |
print(f'Request from Anvil with URL {url}, faking a long ass request that takes 15 seconds')
|
@@ -62,6 +62,7 @@ def render_api_elements(url_input, download_status, output_text, sub_video):
|
|
62 |
with gr.Group() as api_buttons:
|
63 |
# This is a hack to get APIs registered with the blocks interface
|
64 |
translate_result = gr.Textbox(visible=False)
|
|
|
65 |
gr.Button("API", visible=False)\
|
66 |
.click(api_name='cleanup_output_dir',
|
67 |
fn=cleanup_output_dir, queue=True, inputs=[], outputs=[])
|
@@ -69,7 +70,7 @@ def render_api_elements(url_input, download_status, output_text, sub_video):
|
|
69 |
.click(api_name='test_api', queue=True, fn=test_api, inputs=[url_input], outputs=[])
|
70 |
|
71 |
gr.Button("remote_download", visible=False)\
|
72 |
-
.click(api_name='remote_download', queue=True, fn=remote_download, inputs=[url_input], outputs=[download_status, output_text, translate_result])
|
73 |
return api_buttons
|
74 |
|
75 |
|
|
|
48 |
print(final_response)
|
49 |
if 'sub_video' in response:
|
50 |
subbed_video_media = response['sub_video']
|
51 |
+
return subbed_video_media, final_response, whisper_result["text"], whisper_result["language"]
|
52 |
|
53 |
def test_api(url=''):
|
54 |
print(f'Request from Anvil with URL {url}, faking a long ass request that takes 15 seconds')
|
|
|
62 |
with gr.Group() as api_buttons:
|
63 |
# This is a hack to get APIs registered with the blocks interface
|
64 |
translate_result = gr.Textbox(visible=False)
|
65 |
+
translate_language = gr.Textbox(visible=False)
|
66 |
gr.Button("API", visible=False)\
|
67 |
.click(api_name='cleanup_output_dir',
|
68 |
fn=cleanup_output_dir, queue=True, inputs=[], outputs=[])
|
|
|
70 |
.click(api_name='test_api', queue=True, fn=test_api, inputs=[url_input], outputs=[])
|
71 |
|
72 |
gr.Button("remote_download", visible=False)\
|
73 |
+
.click(api_name='remote_download', queue=True, fn=remote_download, inputs=[url_input], outputs=[download_status, output_text, translate_result, translate_language])
|
74 |
return api_buttons
|
75 |
|
76 |
|