import gradio as gr from transformers import pipeline asr = pipeline("automatic-speech-recognition", model="your-hf-username/asr-minds14-model") def transcribe(audio): result = asr(audio)["text"] return result iface = gr.Interface( fn=transcribe, inputs=gr.Audio(source="microphone", type="filepath", label="🎙️ พูดหรืออัปโหลดเสียง"), outputs="text", title="🗣️ ASR: Speech to Text", description="พูดใส่ไมโครโฟนหรืออัปโหลดไฟล์เสียงเพื่อให้โมเดลถอดข้อความให้คุณ (ใช้ Wav2Vec2 บน MInDS-14)" ) iface.launch()