File size: 462 Bytes
3cc08f2
3448a7c
 
3cc08f2
55c2266
 
6d9b516
39e6918
170edeb
c132e74
3448a7c
c7a64c1
3448a7c
cf7f5dc
fadebb0
cf7f5dc
c7a64c1
3cc08f2
3448a7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from transformers import pipeline
import numpy as np

transcriber = pipeline("automatic-speech-recognition", model="filipzawadka/whisper-small-pl-2")
#transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-small.en")


def transcribe(audio):
    return transcriber(audio)["text"]


demo = gr.Interface(
    fn=transcribe,
    inputs=gr.Audio(sources=["microphone"],type="filepath"),
    outputs="text",
)

demo.launch()