oyemade commited on
Commit
6bca603
1 Parent(s): 3df52a6

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ pipe = pipeline("automatic-speech-recognition", model="oyemade/w2v-bert-2.0-hausa-CV17.0")
5
+
6
+ def transcribe(audio):
7
+ text = pipe(audio)["text"]
8
+ return text
9
+
10
+ iface = gr.Interface(
11
+ transcribe,
12
+ gr.Audio(sources="microphone", type="filepath"),
13
+ "text",
14
+ title="Neoform AI: Hausa Speech Recognition",
15
+ description="Realtime demo for Hausa speech recognition using a fine-tuned Wav2Vec-Bert model. NOTE: If you get an error after pressing submit, give the audio some secs to load then try again.",
16
+ )
17
+
18
+ iface.launch()