Spaces:
Build error
Build error
upd
Browse files
app.py
CHANGED
@@ -5,16 +5,16 @@ import whisper
|
|
5 |
|
6 |
model = whisper.load_model("base.en")
|
7 |
|
8 |
-
def fun(audio
|
|
|
|
|
|
|
|
|
|
|
9 |
text = model.transcribe(audio)["text"]
|
10 |
state += text + " "
|
11 |
return state, state
|
12 |
|
13 |
-
def transcribe(audio, state=""):
|
14 |
-
text = p(audio)["text"]
|
15 |
-
state += text + " "
|
16 |
-
return state, state
|
17 |
-
|
18 |
# Set the starting state to an empty string
|
19 |
|
20 |
#gr.Interface(
|
@@ -34,10 +34,10 @@ gr.Interface(
|
|
34 |
title = 'Testing Whisper',
|
35 |
fn=fun,
|
36 |
inputs=[
|
37 |
-
gr.Audio(source="microphone", streaming = True,
|
38 |
-
|
39 |
],
|
40 |
outputs=[
|
41 |
-
"textbox", "state"
|
42 |
],
|
43 |
live=True).launch()
|
|
|
5 |
|
6 |
model = whisper.load_model("base.en")
|
7 |
|
8 |
+
def fun(audio) : #, state=''):
|
9 |
+
text = model.transcribe(audio)["text"]
|
10 |
+
#state += text + " "
|
11 |
+
return text
|
12 |
+
|
13 |
+
def fun1(audio, state=''):
|
14 |
text = model.transcribe(audio)["text"]
|
15 |
state += text + " "
|
16 |
return state, state
|
17 |
|
|
|
|
|
|
|
|
|
|
|
18 |
# Set the starting state to an empty string
|
19 |
|
20 |
#gr.Interface(
|
|
|
34 |
title = 'Testing Whisper',
|
35 |
fn=fun,
|
36 |
inputs=[
|
37 |
+
gr.Audio(source="microphone", type="filepath"), #streaming = True,
|
38 |
+
# "state"
|
39 |
],
|
40 |
outputs=[
|
41 |
+
"textbox", # "state"
|
42 |
],
|
43 |
live=True).launch()
|