whisper-swedish / app.py
SamuelHarner's picture
Upload 3 files
5845aec
raw
history blame
626 Bytes
from transformers import pipeline
import gradio as gr
from song_guesser import SongGuesser
pipe = pipeline(model="MarieGotthardt/whisper") # change to "your-username/the-name-you-picked"
def transcribe(audio):
text = pipe(audio)["text"]
return text
def get_song_guess(audio):
user_query = transcribe(audio)
return "Du sjöng: " + SongGuesser.guess_song(user_query)
iface = gr.Interface(
fn=get_song_guess,
inputs=gr.Audio(source="microphone", type="filepath"),
outputs="text",
title="Whisper Small Swedish",
description="Sjung en sång och låt oss gissa 🎤🎄",
)
iface.launch()