antonbol commited on
Commit
e3dab4e
·
1 Parent(s): 8e20bdc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from numpy import random
4
  from PIL import Image
5
  pipe = pipeline(model="fimster/whisper-small-sv-SE") # change to "your-username/the-name-you-picked"
6
  images = ["katt", "melon", "hund", "banan"]
7
- # image = random.choice(images)
8
 
9
  def transcribe(audio, img):
10
  text = pipe(audio)["text"]
@@ -20,7 +20,7 @@ def transcribe(audio, img):
20
 
21
  iface = gr.Interface(
22
  fn=transcribe,
23
- inputs=[gr.Audio(source="microphone", type="filepath"), gr.Image("./images/" + random.choice(images) + ".jpeg")],
24
  outputs="text",
25
  title="Whisper Small Swedish",
26
  description="Demo of whisper small ASR fine tuned to swedish. Vad är det på bilden? Spela in ditt svar genom att trycka på inspelningsknappen!",
 
4
  from PIL import Image
5
  pipe = pipeline(model="fimster/whisper-small-sv-SE") # change to "your-username/the-name-you-picked"
6
  images = ["katt", "melon", "hund", "banan"]
7
+ image = random.choice(images)
8
 
9
  def transcribe(audio, img):
10
  text = pipe(audio)["text"]
 
20
 
21
  iface = gr.Interface(
22
  fn=transcribe,
23
+ inputs=[gr.Audio(source="microphone", type="filepath"), gr.Image("./images/" + image + ".jpeg")],
24
  outputs="text",
25
  title="Whisper Small Swedish",
26
  description="Demo of whisper small ASR fine tuned to swedish. Vad är det på bilden? Spela in ditt svar genom att trycka på inspelningsknappen!",