kresnik commited on
Commit
cc28349
1 Parent(s): ffea93b
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from transformers import pipeline, AutoModelForCTC, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM
3
 
4
 
@@ -12,9 +13,9 @@ p=pipeline("automatic-speech-recognition", model="kresnik/wav2vec2-large-xlsr-ko
12
  def transcribe(audio, state=""):
13
  time.sleep(2)
14
  text = p(audio)["text"]
15
- #state+= text+ " "
16
- #return state, state
17
- return text
18
 
19
  gr.Interface(
20
  fn=transcribe,
@@ -37,6 +38,6 @@ gr.Interface(
37
  allow_screenshot=False,
38
  allow_flagging="never",
39
  theme="grass",
40
- live=False
41
  ).launch()
42
 
1
  import gradio as gr
2
+ import time
3
  from transformers import pipeline, AutoModelForCTC, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM
4
 
5
 
13
  def transcribe(audio, state=""):
14
  time.sleep(2)
15
  text = p(audio)["text"]
16
+ state+= text+ " "
17
+ return state, state
18
+ #return text
19
 
20
  gr.Interface(
21
  fn=transcribe,
38
  allow_screenshot=False,
39
  allow_flagging="never",
40
  theme="grass",
41
+ live=True
42
  ).launch()
43