Kotoba-whisper / app.py
yichen0403's picture
Update app.py
b2f7a04 verified
raw
history blame contribute delete
491 Bytes
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()