Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Load the Nigerian Accented English ASR model | |
transcriber = pipeline("automatic-speech-recognition", model="NCAIR1/NigerianAccentedEnglish") | |
def transcribe_audio(audio): | |
""" | |
Transcribe audio file using the Nigerian Accented English model | |
""" | |
if audio is None: | |
return "Please upload an audio file." | |
try: | |
# Transcribe the audio | |
result = transcriber(audio) | |
return result["text"] | |
except Exception as e: | |
return f"Error: {str(e)}" | |
# Create Gradio interface | |
demo = gr.Interface( | |
fn=transcribe_audio, | |
inputs=gr.Audio(type="filepath", label="Upload Audio File"), | |
outputs=gr.Textbox(label="Transcript"), | |
title="Nigerian Accented English Transcription", | |
description="Upload an audio file to get a transcript using the NCAIR1/NigerianAccentedEnglish model.", | |
examples=[] | |
) | |
if __name__ == "__main__": | |
demo.launch() |