Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created May 18, 2023 20:18
Show Gist options
  • Select an option

  • Save ehzawad/3a6236237cd23b84d9eaadf44c602680 to your computer and use it in GitHub Desktop.

Select an option

Save ehzawad/3a6236237cd23b84d9eaadf44c602680 to your computer and use it in GitHub Desktop.
from transformers import pipeline
import gradio as gr
pipe = pipeline(model="ehzawad/whisper-tiny-bn")
def transcribe(audio):
text = pipe(audio)["text"]
return text
iface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(source="microphone", type="filepath"),
outputs="text",
title="Whisper Tiny Bengali Model Inference",
description="Realtime demo for Bengali speech recognition using a fine-tuned Whisper tiny model.",
)
iface.launch(share=True)
@ehzawad

ehzawad commented May 18, 2023

Copy link
Copy Markdown
Author

pip install --user transformers
pip install --user gradio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment