Speech2Text_Ge / app.py
Tlanextli's picture
Create app.py
3198280
raw
history blame
454 Bytes
import os
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="automatic-speech-recognition", model="openai/whisper-large")
def transcribe(audiofile):
transcription = pipeline(audiofile)
return transcription
demo = gr.Interface(
fn=transcribe,
inputs="microphone",
#inputs=gr.inputs.Audio(label="Upload audio file", type="filepath"),
outputs="text"
)
if __name__ == "__main__":
demo.launch()