Kimang18 commited on
Commit
0dfeb3e
·
verified ·
1 Parent(s): 78b0276

Create app file

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import mlx_whisper
3
+
4
+ def transcribe(audio):
5
+ text = mlx_whisper.transcribe(
6
+ audio,
7
+ path_or_hf="Kimang18/whisper-tiny-khmer-mlx-fp32",
8
+ fp16=False,
9
+ condition_on_previous_text=False,
10
+ )['text']
11
+ return text
12
+
13
+ iface = gr.Interface(
14
+ fn=transcribe,
15
+ inputs=gr.Audio(type="filepath", waveform_options={"sample_rate": 16000}),
16
+ outputs="text",
17
+ title="Whisper Tiny Khmer",
18
+ description="Realtime demo for Khmer speech transcription using a fine-tuned Whisper tiny model.",
19
+ )
20
+
21
+ iface.launch(share=False)