martenb commited on
Commit
84494b4
·
1 Parent(s): 5e0fe36

Updated app at mån 4 dec 2023 07:40:52 CET

Browse files
Files changed (2) hide show
  1. app.py +20 -0
  2. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ pipe = pipeline(model="martenb/whisper-small-sv") # change to "your-username/the-name-you-picked"
5
+
6
+
7
+ def transcribe(audio):
8
+ text = pipe(audio)["text"]
9
+ return text
10
+
11
+
12
+ iface = gr.Interface(
13
+ fn=transcribe,
14
+ inputs=gr.Audio(), # Removed the 'source' and 'type' arguments
15
+ outputs="text",
16
+ title="Whisper Small Swedish",
17
+ description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
18
+ )
19
+
20
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ transformers