|
import gradio as gr |
|
|
|
whisper = gr.load("models/openai/whisper-small") |
|
|
|
def inference(audio): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return whisper(audio).replace("AutomaticSpeechRecognitionOutput(text=' ", "").replace("', chunks=None)", "") |
|
|
|
article = """ |
|
## εθ |
|
- [Innev GitHub](https://github.com/innev) |
|
""" |
|
|
|
gr.Interface( |
|
fn=inference, |
|
api_name="predict", |
|
inputs=[ |
|
gr.Audio(label="ε½εΆθ―ι³", source="microphone", type="filepath") |
|
], |
|
outputs=[ |
|
gr.Text(label="θ―ε«εΊηζε") |
|
], |
|
title="Whisper Speech Recognition", |
|
article=article |
|
).launch() |