Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ model_name = "pgilles/whisper-large-v2-lb_cased_01"
|
|
27 |
#model = model.to(device)
|
28 |
|
29 |
#p = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer, feature_extractor=processor.feature_extractor, decoder=processor.decoder, use_auth_token=token_key)
|
30 |
-
p = pipeline("automatic-speech-recognition", model=model_name, device=0)
|
31 |
|
32 |
#p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = token_key)
|
33 |
#p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = True)
|
@@ -49,9 +49,14 @@ def asr_pipe(input_file):
|
|
49 |
load_data(input_file)
|
50 |
transcription = p(input_file, chunk_length_s=3, stride_length_s=(0.5, 0.5))["text"]
|
51 |
return transcription
|
52 |
-
|
|
|
|
|
|
|
|
|
53 |
gr.Interface(asr_pipe,
|
54 |
-
inputs = gr.inputs.Audio(source="microphone", type="filepath", optional=True, label="Hei kënnt Dir Är Sprooch iwwert de Mikro ophuelen"),
|
|
|
55 |
outputs = gr.outputs.Textbox(label="Erkannten Text"),
|
56 |
title="Sproocherkennung fir d'Lëtzebuergescht @uni.lu",
|
57 |
description = "Dës App convertéiert Är geschwate Sprooch an de (méi oder manner richtegen ;-)) Text! Dir kënnt Iech selwer iwwer de Mikro ophuelen (am beschten 5 bis 10 Sekonnen) oder e Beispill ënnen auswielen. Den erkannten Text gëtt da riets gewisen. D''Word Error Rate' vun dësem Modell läit bei 14, d.h. vun 100 Wierder ginn der 14 net richteg erkannt.",
|
|
|
27 |
#model = model.to(device)
|
28 |
|
29 |
#p = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer, feature_extractor=processor.feature_extractor, decoder=processor.decoder, use_auth_token=token_key)
|
30 |
+
p = pipeline("automatic-speech-recognition", model=model_name, chunk_length_s = 29, device=0)
|
31 |
|
32 |
#p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = token_key)
|
33 |
#p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = True)
|
|
|
49 |
load_data(input_file)
|
50 |
transcription = p(input_file, chunk_length_s=3, stride_length_s=(0.5, 0.5))["text"]
|
51 |
return transcription
|
52 |
+
|
53 |
+
input1=[gr.inputs.Audio(source="microphone", type='filepath', label="Click and Start Speaking..."), "state"]
|
54 |
+
input2=gr.inputs.Audio(source="upload", type='filepath', label="Load your own file...")
|
55 |
+
inputs=[input1, input2]
|
56 |
+
|
57 |
gr.Interface(asr_pipe,
|
58 |
+
#inputs = gr.inputs.Audio(source="microphone", type="filepath", optional=True, label="Hei kënnt Dir Är Sprooch iwwert de Mikro ophuelen"),
|
59 |
+
inputs = inputs,
|
60 |
outputs = gr.outputs.Textbox(label="Erkannten Text"),
|
61 |
title="Sproocherkennung fir d'Lëtzebuergescht @uni.lu",
|
62 |
description = "Dës App convertéiert Är geschwate Sprooch an de (méi oder manner richtegen ;-)) Text! Dir kënnt Iech selwer iwwer de Mikro ophuelen (am beschten 5 bis 10 Sekonnen) oder e Beispill ënnen auswielen. Den erkannten Text gëtt da riets gewisen. D''Word Error Rate' vun dësem Modell läit bei 14, d.h. vun 100 Wierder ginn der 14 net richteg erkannt.",
|