ysharma HF staff commited on
Commit
9ca6873
1 Parent(s): 6cecd2b
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -5,16 +5,16 @@ import whisper
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 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, type="filepath"),
38
- "state"
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()