Chrysoula commited on
Commit
c1ac5b6
·
1 Parent(s): c0d6c5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -4,10 +4,13 @@ import gradio as gr
4
  pipe = pipeline(model="Hoft/whisper-small-swedish-asr") # change to "your-username/the-name-you-picked"
5
 
6
  def transcribe(audio, file):
7
- print(audio)
8
- print(file)
9
- text = pipe(audio)["text"]
10
- return text
 
 
 
11
 
12
  iface = gr.Interface(
13
  fn=transcribe,
 
4
  pipe = pipeline(model="Hoft/whisper-small-swedish-asr") # change to "your-username/the-name-you-picked"
5
 
6
  def transcribe(audio, file):
7
+ print(audio, file)
8
+ if audio is not None:
9
+ text = pipe(audio)["text"]
10
+ return text
11
+ if file is not None:
12
+ text = pipe(file)["text"]
13
+ return text
14
 
15
  iface = gr.Interface(
16
  fn=transcribe,