Commit
·
477dd54
1
Parent(s):
7c82caf
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
checkpoint="dreahim/whisper-small-Egyptian_ASR_3train_2dev_v1"
|
5 |
|
6 |
+
ASRPipeline = pipeline(task="automatic-speech-recognition", model=checkpoint)
|
7 |
+
|
8 |
+
def Recognize(audiofile):
|
9 |
+
sr, audio = audiofile
|
10 |
+
result=ASRPipeline(audio)
|
11 |
+
return result
|
12 |
+
|
13 |
+
demo= gr.Interface(fn=Recognize,title=checkpoint, inputs=gr.Audio(), outputs=gr.Textbox())
|
14 |
+
|
15 |
+
if __name__ == "__main__":
|
16 |
+
demo.launch(share=True)
|