HenRick69 commited on
Commit
7913547
1 Parent(s): 830d61c

Update app.py

Browse files

Changing the input format

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,13 +4,13 @@ from transformers import pipeline
4
  pipe = pipeline("audio-classification",
5
  model="juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands")
6
 
7
- def predict(audio):
8
- return pipe(audio)[0]["label"]
9
 
10
  demo = gr.Interface(
11
  title='Audio commands datection',
12
  fn=predict,
13
- inputs='audio',
14
  outputs='text',
15
  )
16
 
 
4
  pipe = pipeline("audio-classification",
5
  model="juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands")
6
 
7
+ def predict(audio_path):
8
+ return pipe(audio_path)[0]["label"]
9
 
10
  demo = gr.Interface(
11
  title='Audio commands datection',
12
  fn=predict,
13
+ inputs=gr.Audio(source="upload", type='filepath'),
14
  outputs='text',
15
  )
16