Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 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="jonatasgrosman/wav2vec2-large-xlsr-53-german")
|
| 10 |
#pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
|
| 11 |
|
| 12 |
def transcribe(audio_path : str) -> str:
|
| 13 |
transcription = pipeline(audio_path)
|
| 14 |
-
return transcription
|
| 15 |
|
| 16 |
|
| 17 |
demo = gr.Interface(
|
|
|
|
| 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="jonatasgrosman/wav2vec2-large-xlsr-53-german")
|
| 10 |
#pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
|
| 11 |
|
| 12 |
def transcribe(audio_path : str) -> str:
|
| 13 |
transcription = pipeline(audio_path)
|
| 14 |
+
return transcription["text"]
|
| 15 |
|
| 16 |
|
| 17 |
demo = gr.Interface(
|