Spaces:
Sleeping
Sleeping
Antoniskaraolis
commited on
Commit
·
482a875
1
Parent(s):
b533d99
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,8 @@ import soundfile as sf
|
|
5 |
asr_model = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
6 |
|
7 |
def transcribe(audio_file):
|
8 |
-
|
9 |
-
|
10 |
-
transcription = asr_model(data, samplerate=samplerate)
|
11 |
return transcription["text"]
|
12 |
|
13 |
iface = gr.Interface(
|
@@ -16,4 +15,4 @@ iface = gr.Interface(
|
|
16 |
outputs="text"
|
17 |
)
|
18 |
|
19 |
-
iface.launch()
|
|
|
5 |
asr_model = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
6 |
|
7 |
def transcribe(audio_file):
|
8 |
+
data, samplerate = sf.read(audio_file.name)
|
9 |
+
transcription = asr_model(data, sampling_rate=samplerate)
|
|
|
10 |
return transcription["text"]
|
11 |
|
12 |
iface = gr.Interface(
|
|
|
15 |
outputs="text"
|
16 |
)
|
17 |
|
18 |
+
iface.launch()
|