Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| print("Loading Breeze-ASR-26 model...") | |
| pipe = pipeline( | |
| "automatic-speech-recognition", | |
| model="MediaTek-Research/Breeze-ASR-26", | |
| device="cpu" | |
| ) | |
| print("Model loaded!") | |
| def transcribe(audio): | |
| if audio is None: | |
| return "" | |
| return pipe(audio)["text"] | |
| demo = gr.Interface( | |
| fn=transcribe, | |
| inputs=gr.Audio(type="filepath", label="上傳音訊"), | |
| outputs=gr.Textbox(label="辨識結果"), | |
| title="Breeze ASR - 台語語音辨識" | |
| # ← 把 allow_flagging="never" 整行刪掉 | |
| ) | |
| demo.launch() |