File size: 492 Bytes
fac06d0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from transformers import pipeline
import gradio as gr
import time
pipe = pipeline("automatic-speech-recognition", model="Artanis1551/whisper_romanian3")
def transcribe(audio, state=""):
text = pipe(audio)["text"]
state += text + " "
return state, state
gr.Interface(
title="Romanian Speech Transcription",
fn=transcribe,
inputs=[gr.Audio(source="microphone", type="filepath", streaming=True), "state"],
outputs=["textbox", "state"],
live=True,
).launch()
|