whisper / app.py
pierrelf's picture
Restore base functionality
e357f89
raw
history blame contribute delete
533 Bytes
from transformers import pipeline
import gradio as gr
pipe = pipeline(model="pierrelf/whisper-small-sv")
def transcribe(audio):
text = pipe(audio)["text"]
return text
iface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(sources=["upload", "microphone"], type="filepath"),
outputs=gr.Text(label="Model output"),
title="Whisper Swedish",
description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
)
iface.launch(
server_name="0.0.0.0",
share=False,
)