lorem commited on
Commit
42bc6b1
·
verified ·
1 Parent(s): d28fad4

Update app.py

Browse files

Whole code changed (copied)

Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
- import time
3
  from transformers import pipeline
 
4
 
5
- transcriber = pipeline('automatic-speech-recognition',model = "openai/whisper-tiny")
6
 
7
  def transcribe(audio):
8
  sr, y = audio
@@ -11,9 +11,11 @@ def transcribe(audio):
11
 
12
  return transcriber({"sampling_rate": sr, "raw": y})["text"]
13
 
 
14
  demo = gr.Interface(
15
  transcribe,
16
  gr.Audio(sources=["microphone"]),
17
- "text"
18
- )
19
- demo.launch()
 
 
1
  import gradio as gr
 
2
  from transformers import pipeline
3
+ import numpy as np
4
 
5
+ transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
6
 
7
  def transcribe(audio):
8
  sr, y = audio
 
11
 
12
  return transcriber({"sampling_rate": sr, "raw": y})["text"]
13
 
14
+
15
  demo = gr.Interface(
16
  transcribe,
17
  gr.Audio(sources=["microphone"]),
18
+ "text",
19
+ )
20
+
21
+ demo.launch()