ID2223-Lab2 / app.py
FredBonux's picture
Update app.py
8c667fc
raw
history blame
549 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("automatic-speech-recognition", model="FredBonux/whisper-small-it")
def transcribe(audio):
text = pipe(audio)["text"]
return text
# demo = gr.Interface.from_pipeline(pipe)
# demo.launch()
iface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(sources=["microphone"], type="filepath"),
outputs="text",
title="Whisper Small Italian",
description="Realtime demo for Italian speech recognition using a fine-tuned Whisper small model.",
)
iface.launch()