Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,17 +2,14 @@ from transformers import pipeline
|
|
2 |
import gradio as gr
|
3 |
from pyctcdecode import BeamSearchDecoderCTC
|
4 |
|
5 |
-
lmID = "aware-ai/german-lowercase-wiki-5gram"
|
6 |
-
decoder = BeamSearchDecoderCTC.load_from_hf_hub(lmID)
|
7 |
-
p = pipeline("automatic-speech-recognition", model="aware-ai/
|
8 |
ttp = pipeline("text2text-generation", model="aware-ai/marian-german-grammar")
|
9 |
|
10 |
-
hotwords = [
|
11 |
-
"hilfe"
|
12 |
-
]
|
13 |
|
14 |
def transcribe(audio):
|
15 |
-
transcribed = p(audio, chunk_length_s=16, stride_length_s=(4, 0)
|
16 |
transcribed = punctuate(transcribed)
|
17 |
return transcribed
|
18 |
|
|
|
2 |
import gradio as gr
|
3 |
from pyctcdecode import BeamSearchDecoderCTC
|
4 |
|
5 |
+
#lmID = "aware-ai/german-lowercase-wiki-5gram"
|
6 |
+
#decoder = BeamSearchDecoderCTC.load_from_hf_hub(lmID)
|
7 |
+
p = pipeline("automatic-speech-recognition", model="aware-ai/wav2vec2-xls-r-1b-5gram-german")
|
8 |
ttp = pipeline("text2text-generation", model="aware-ai/marian-german-grammar")
|
9 |
|
|
|
|
|
|
|
10 |
|
11 |
def transcribe(audio):
|
12 |
+
transcribed = p(audio, chunk_length_s=16, stride_length_s=(4, 0))["text"]
|
13 |
transcribed = punctuate(transcribed)
|
14 |
return transcribed
|
15 |
|