File size: 479 Bytes
ce4780c
 
 
 
215fe57
ce4780c
 
 
 
 
 
 
 
bef7852
ce4780c
10bd6bd
5faf8f3
ce4780c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from transformers import pipeline

# بارگذاری مدل
model = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3")

# تابع پردازش ورودی
def transcribe(audio):
    return model(audio)["text"]

# ایجاد رابط کاربری با Gradio
demo = gr.Interface(
    fn=transcribe,
    inputs=gr.Audio(type="filepath"),
    outputs="text",
    title="Pergas ASR demo!",
    description="New ASR demo."
)

demo.launch()