MaximilianChen commited on
Commit
9d3afd7
1 Parent(s): 3a6c9ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -1,3 +1,21 @@
 
1
  import gradio as gr
2
 
3
- gr.Interface.load("models/MaximilianChen/Casper").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
  import gradio as gr
3
 
4
+ pipe = pipeline(model="MaximilianChen/Casper")
5
+
6
+ def transcribe(audio):
7
+ text = pipe(audio)["text"]
8
+ return text
9
+
10
+ iface = gr.Interface(
11
+ fn=transcribe,
12
+ inputs=[
13
+ gr.Audio(label="Upload Speech", source="upload", type="numpy"),
14
+ gr.Audio(label="Record Speech", source="microphone", type="numpy"),
15
+ ],
16
+ outputs="text",
17
+ title="Casper",
18
+ description="Realtime demo for Catalan speech recognition using a fine-tuned Whisper small model.",
19
+ )
20
+
21
+ iface.launch()