ASR-w2v-bert_p / app.py
ashik1104's picture
Update app.py
31edb58 verified
raw
history blame contribute delete
589 Bytes
import gradio as gr
from transformers import pipeline
asr_pipeline = pipeline("automatic-speech-recognition", model="ashik1104/Bengali_wav2vec2_BERT_P")
def transcribe(audio):
result = asr_pipeline(audio)
return result["text"]
gradio_app = gr.Interface(
fn=transcribe,
inputs=gr.Audio(type="filepath", label="Upload or record audio"),
outputs=gr.Textbox(label="Transcription"),
title="🎤 Automatic Speech Recognition (ASR)",
description="Upload a file or record your voice to get the transcription.",
)
if __name__ == "__main__":
gradio_app.launch()