Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
pipe = pipeline(
|
5 |
+
model="anggiatm/whisper-small-id"
|
6 |
+
) # change to "your-username/the-name-you-picked"
|
7 |
+
|
8 |
+
|
9 |
+
def transcribe(audio):
|
10 |
+
text = pipe(audio)["text"]
|
11 |
+
return text
|
12 |
+
|
13 |
+
|
14 |
+
iface = gr.Interface(
|
15 |
+
fn=transcribe,
|
16 |
+
inputs=gr.Audio(type="filepath"),
|
17 |
+
outputs="text",
|
18 |
+
title="Whisper Small Indonesian",
|
19 |
+
description="Realtime demo for Indonesian speech recognition using a fine-tuned Whisper small model.",
|
20 |
+
)
|
21 |
+
|
22 |
+
iface.launch()
|