Issamohammed commited on
Commit
edbeae5
·
verified ·
1 Parent(s): d4a89d9

Create App.py

Browse files
Files changed (1) hide show
  1. App.py +17 -0
App.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Use whisper-base for better Swedish transcription on CPU
5
+ asr = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=-1)
6
+
7
+ def transcribe(audio):
8
+ result = asr(audio)
9
+ return result["text"]
10
+
11
+ gr.Interface(
12
+ fn=transcribe,
13
+ inputs=gr.Audio(source="upload", type="filepath", label="Upload Swedish Audio"),
14
+ outputs=gr.Textbox(label="Transcribed Text (Swedish)"),
15
+ title="Swedish Whisper Transcriber",
16
+ description="This app uses OpenAI Whisper (base) to transcribe spoken Swedish into text for free."
17
+ ).launch()