Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,22 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
|
|
4 |
|
5 |
|
|
|
|
|
6 |
pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
|
7 |
|
8 |
-
def transcribe(
|
9 |
-
transcription = pipeline(
|
10 |
return transcription
|
11 |
|
12 |
|
13 |
demo = gr.Interface(
|
14 |
fn=transcribe,
|
15 |
-
inputs="microphone",
|
16 |
-
|
17 |
outputs="text"
|
18 |
)
|
19 |
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
+
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
|
5 |
|
6 |
|
7 |
+
MODEL_ID = "jonatasgrosman/wav2vec2-large-xlsr-53-german"
|
8 |
+
|
9 |
pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
|
10 |
|
11 |
+
def transcribe(audio_path : str) -> str:
|
12 |
+
transcription = pipeline(audio_path)
|
13 |
return transcription
|
14 |
|
15 |
|
16 |
demo = gr.Interface(
|
17 |
fn=transcribe,
|
18 |
+
#inputs="microphone",
|
19 |
+
inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
|
20 |
outputs="text"
|
21 |
)
|
22 |
|