Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # 加载 kotoba-whisper-v2.2 | |
| speech_recognition_pipeline = pipeline("automatic-speech-recognition", model="kotoba-tech/kotoba-whisper-v2.2") | |
| def transcribe(audio): | |
| result = speech_recognition_pipeline(audio) | |
| return result['text'] | |
| # 创建 Gradio 接口 | |
| demo = gr.Interface( | |
| fn=transcribe, | |
| inputs=gr.Audio(sources="upload", type="filepath"), | |
| outputs="text", | |
| title="Japanese Speech Recognition" | |
| ) | |
| demo.launch() |