Spaces:
Sleeping
Sleeping
Ludvig Doeser
commited on
Commit
•
cc130eb
1
Parent(s):
aabe8ad
Added app
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
pipe = pipeline(model="LudvigDoeser/swedish_asr_model_training") # change to "your-username/the-name-you-picked"
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
def transcribe(audio):
|
8 |
+
text = pipe(audio)["text"]
|
9 |
+
return text
|
10 |
+
|
11 |
+
iface = gr.Interface(
|
12 |
+
fn=transcribe,
|
13 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
14 |
+
outputs="text",
|
15 |
+
title="Whisper Small Swedish",
|
16 |
+
description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
|
17 |
+
)
|
18 |
+
|
19 |
+
iface.launch()
|