asr / app.py
TonmoyKroos's picture
Update app.py
0b9e38f verified
Raw
History Blame Contribute Delete
606 Bytes
import spaces
import gradio as gr
from transformers import pipeline
MODEL_NAME = "bangla-speech-processing/BanglaASR"
print("Loading model...")
pipe = pipeline(
task="automatic-speech-recognition",
model=MODEL_NAME,
)
print("Model loaded.")
@spaces.GPU
def transcribe(audio):
if audio is None:
return ""
result = pipe(audio)
return result["text"]
demo = gr.Interface(
fn=transcribe,
inputs=gr.Audio(type="filepath"),
outputs=gr.Textbox(),
title="Bangla Speech Recognition",
description="Bangla ASR using Hugging Face ZeroGPU",
)
demo.launch()