File size: 586 Bytes
fac06d0
 
 
 
 
 
 
534a7d7
 
 
 
 
 
 
 
d14f075
fac06d0
534a7d7
fac06d0
 
534a7d7
 
fac06d0
534a7d7
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from transformers import pipeline
import gradio as gr
import time

pipe = pipeline("automatic-speech-recognition", model="Artanis1551/whisper_romanian3")


def transcribe(rec=None, state=""):
    if rec is not None:
        audio = rec
        text = pipe(audio)["text"]
        state += text + ". "
    else:
        text = ""
    return text, state


iface = gr.Interface(
    fn=transcribe,
    inputs=[gr.Audio(source="microphone", type="filepath", streaming=True), "state"],
    outputs=["text", "state"],
    title="Romanian Transcription Test",
    live=True,
)


iface.launch()