Spaces:
Paused
Paused
Add wiki pqssqge
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
os.system("pip install git+https://github.com/openai/whisper.git")
|
3 |
import gradio as gr
|
4 |
import whisper
|
@@ -6,6 +7,8 @@ import whisper
|
|
6 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
7 |
|
8 |
model = whisper.load_model("small")
|
|
|
|
|
9 |
|
10 |
|
11 |
|
@@ -21,6 +24,7 @@ def inference(audio):
|
|
21 |
result = whisper.decode(model, mel, options)
|
22 |
|
23 |
print(result.text)
|
|
|
24 |
return result.text, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
25 |
|
26 |
|
|
|
1 |
import os
|
2 |
+
import wikipedia
|
3 |
os.system("pip install git+https://github.com/openai/whisper.git")
|
4 |
import gradio as gr
|
5 |
import whisper
|
|
|
7 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
8 |
|
9 |
model = whisper.load_model("small")
|
10 |
+
wikipedia.set_lang("en")
|
11 |
+
passage = wikipedia.summary("Ornithorynque", sentences=3)
|
12 |
|
13 |
|
14 |
|
|
|
24 |
result = whisper.decode(model, mel, options)
|
25 |
|
26 |
print(result.text)
|
27 |
+
print(passage)
|
28 |
return result.text, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
29 |
|
30 |
|