Commit
·
fc7482c
1
Parent(s):
bf691a8
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,8 @@ os.system("pip install git+https://github.com/openai/whisper.git")
|
|
3 |
import gradio as gr
|
4 |
import whisper
|
5 |
|
6 |
-
from share_btn import community_icon_html, loading_icon_html
|
7 |
-
|
8 |
model = whisper.load_model("small")
|
9 |
|
10 |
-
|
11 |
|
12 |
def inference(audio):
|
13 |
audio = whisper.load_audio(audio)
|
@@ -103,7 +100,6 @@ css = """
|
|
103 |
block = gr.Blocks(css=css)
|
104 |
|
105 |
|
106 |
-
|
107 |
with block:
|
108 |
gr.HTML(
|
109 |
"""
|
@@ -173,7 +169,7 @@ with block:
|
|
173 |
btn = gr.Button("Transcribe")
|
174 |
text = gr.Textbox(show_label=False, elem_id="result-textarea")
|
175 |
|
176 |
-
btn.click(inference, inputs=[audio], outputs=[text
|
177 |
|
178 |
gr.HTML('''
|
179 |
<div class="footer">
|
|
|
3 |
import gradio as gr
|
4 |
import whisper
|
5 |
|
|
|
|
|
6 |
model = whisper.load_model("small")
|
7 |
|
|
|
8 |
|
9 |
def inference(audio):
|
10 |
audio = whisper.load_audio(audio)
|
|
|
100 |
block = gr.Blocks(css=css)
|
101 |
|
102 |
|
|
|
103 |
with block:
|
104 |
gr.HTML(
|
105 |
"""
|
|
|
169 |
btn = gr.Button("Transcribe")
|
170 |
text = gr.Textbox(show_label=False, elem_id="result-textarea")
|
171 |
|
172 |
+
btn.click(inference, inputs=[audio], outputs=[text], api_name="transcribe")
|
173 |
|
174 |
gr.HTML('''
|
175 |
<div class="footer">
|