Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,11 @@ default_passage = wikipedia.summary("pirate code", sentences=2)
|
|
12 |
|
13 |
def update_passage(passage_name):
|
14 |
try:
|
15 |
-
|
16 |
except:
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
def inference(audio):
|
21 |
audio = whisper.load_audio(audio)
|
@@ -222,7 +223,7 @@ with block:
|
|
222 |
|
223 |
|
224 |
btn.click(inference, inputs=[audio], outputs=[text, community_icon, loading_icon, share_button])
|
225 |
-
btn2.click(update_passage, inputs=[passage_name], outputs=[passage, text])
|
226 |
share_button.click(None, [], [], _js=share_js)
|
227 |
|
228 |
gr.HTML('''
|
|
|
12 |
|
13 |
def update_passage(passage_name):
|
14 |
try:
|
15 |
+
sum = wikipedia.summary(passage_name, sentences=2)
|
16 |
except:
|
17 |
+
sum = "Please specify your article name differently"
|
18 |
+
|
19 |
+
return sum, "", gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
|
20 |
|
21 |
def inference(audio):
|
22 |
audio = whisper.load_audio(audio)
|
|
|
223 |
|
224 |
|
225 |
btn.click(inference, inputs=[audio], outputs=[text, community_icon, loading_icon, share_button])
|
226 |
+
btn2.click(update_passage, inputs=[passage_name], outputs=[passage, text, community_icon, loading_icon, share_button])
|
227 |
share_button.click(None, [], [], _js=share_js)
|
228 |
|
229 |
gr.HTML('''
|