File size: 612 Bytes
6bca603
 
 
 
 
 
 
 
 
 
 
 
 
 
e1a4f1f
6bca603
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from transformers import pipeline
import gradio as gr

pipe = pipeline("automatic-speech-recognition", model="oyemade/w2v-bert-2.0-hausa-CV17.0") 

def transcribe(audio):
    text = pipe(audio)["text"]
    return text

iface = gr.Interface(
    transcribe,
    gr.Audio(sources="microphone", type="filepath"),
    "text",
    title="Neoform AI: Hausa Speech Recognition",
    description="Realtime demo for Hausa speech recognition using a fine-tuned Wav2Vec-Bert model. https://neoformai.com . NOTE: If you get an error after pressing submit, give the audio some secs to load then try again.",
)

iface.launch()