Spaces:
Runtime error
Runtime error
SajjadAyoubi
commited on
Commit
•
cf6d861
1
Parent(s):
b3fa900
Update app.py
Browse files
app.py
CHANGED
@@ -33,9 +33,11 @@ wav2vec_model = Wav2Vec2ForCTC.from_pretrained(model_name).to(device).eval()
|
|
33 |
processor = Wav2Vec2Processor.from_pretrained(model_name)
|
34 |
s2t = Speech2Text()
|
35 |
|
36 |
-
|
|
|
|
|
37 |
# themes="default", "huggingface", "seafoam", "grass", "peach"
|
38 |
-
gr.Interface(
|
39 |
inputs = gr.inputs.Audio(source="microphone", type="filepath", optional=True, label="Record Your Beautiful Persian Voice"),
|
40 |
outputs = gr.outputs.Textbox(label="Output Text"),
|
41 |
title="Persian ASR using Wav2Vec 2.0",
|
|
|
33 |
processor = Wav2Vec2Processor.from_pretrained(model_name)
|
34 |
s2t = Speech2Text()
|
35 |
|
36 |
+
def asr(path):
|
37 |
+
return s2t(path)
|
38 |
+
|
39 |
# themes="default", "huggingface", "seafoam", "grass", "peach"
|
40 |
+
gr.Interface(asr,
|
41 |
inputs = gr.inputs.Audio(source="microphone", type="filepath", optional=True, label="Record Your Beautiful Persian Voice"),
|
42 |
outputs = gr.outputs.Textbox(label="Output Text"),
|
43 |
title="Persian ASR using Wav2Vec 2.0",
|