Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
import os
|
4 |
|
5 |
def transcribe(audio, language):
|
@@ -24,10 +24,8 @@ def transcribe(audio, language):
|
|
24 |
"bambara": "asr-africa/mms-bambara-50-hours-mixed-bambara-dataset",
|
25 |
}
|
26 |
|
27 |
-
# load processor
|
28 |
-
p = AutoProcessor.from_pretrained(model_map[language])
|
29 |
# load eval pipeline
|
30 |
-
asr = pipeline("automatic-speech-recognition", model=model_map[language],
|
31 |
|
32 |
text = asr(audio)["text"]
|
33 |
return text
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
import os
|
4 |
|
5 |
def transcribe(audio, language):
|
|
|
24 |
"bambara": "asr-africa/mms-bambara-50-hours-mixed-bambara-dataset",
|
25 |
}
|
26 |
|
|
|
|
|
27 |
# load eval pipeline
|
28 |
+
asr = pipeline("automatic-speech-recognition", model=model_map[language], device=0, token=os.getenv('HF_TOKEN'))
|
29 |
|
30 |
text = asr(audio)["text"]
|
31 |
return text
|