akki2825 commited on
Commit
26f728c
1 Parent(s): d509c9b

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +5 -10
run.py CHANGED
@@ -37,21 +37,16 @@ def reformat_freq(sr, y):
37
  return sr, y
38
 
39
 
40
- def transcribe(speech, stream):
41
- _, y = reformat_freq(*speech)
42
- if stream is None:
43
- stream = model.createStream()
44
- stream.feedAudioContent(y)
45
- text = stream.intermediateDecode()
46
- return text, stream
47
 
48
 
49
  demo = gr.Interface(
50
  transcribe,
51
  # [gr.Audio(source="microphone", streaming=True), "state"],
52
- gr.Audio(label="Upload Audio File", source="upload", type="filepath"),
53
- ["text", "state"],
54
- live=True,
55
  )
56
 
57
  if __name__ == "__main__":
 
37
  return sr, y
38
 
39
 
40
+ def transcribe(audio_file):
41
+
42
+ text = model(audio_file)
43
+ return text
 
 
 
44
 
45
 
46
  demo = gr.Interface(
47
  transcribe,
48
  # [gr.Audio(source="microphone", streaming=True), "state"],
49
+ gr.Audio(label="Upload Audio File", source="upload", type="filepath")
 
 
50
  )
51
 
52
  if __name__ == "__main__":