id2223_lab2 / app_origin.py
Chenzhou's picture
Rename app.py to app_origin.py
741aa3b
raw
history blame
509 Bytes
from transformers import pipeline
import gradio as gr
pipe = pipeline(model="tilos/whisper-small-zh-HK") # change to "your-username/the-name-you-picked"
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 Small Cantonese",
description="Realtime demo for Cantonese speech recognition using a fine-tuned Whisper small model.",
)
iface.launch()