Teapack1 commited on
Commit
c4da767
1 Parent(s): 5cbab24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -9,12 +9,6 @@ pipe = pipeline("audio-classification", model=model_id)
9
  title = "Keyword Spotting Wav2Vec2"
10
  description = "Gradio demo for finetuned Wav2Vec2 model on a custom dataset to perform keyword spotting task. Classes are scene 1, scene 2, scene 3, yes, no and stop."
11
 
12
- example_samples = [
13
- ("path_to_audio_file_1.wav",),
14
- ("path_to_audio_file_2.wav",),
15
- # Add more example samples as needed
16
- ]
17
-
18
  demo = gr.Blocks()
19
 
20
  def classify_audio(audio):
@@ -30,6 +24,7 @@ mic_classify = gr.Interface(
30
  inputs=gr.inputs.Audio(source="microphone", type="filepath", label="Record your audio"),
31
  outputs=gr.outputs.Label(),
32
  title=title,
 
33
  description=description
34
  )
35
 
@@ -37,7 +32,8 @@ file_classify = gr.Interface(
37
  fn=classify_audio,
38
  title=title,
39
  description=description,
40
- inputs=gr.Audio(sources="upload", type="filepath", label="Record your audio"),
 
41
  outputs=gr.outputs.Label(),
42
  )
43
 
 
9
  title = "Keyword Spotting Wav2Vec2"
10
  description = "Gradio demo for finetuned Wav2Vec2 model on a custom dataset to perform keyword spotting task. Classes are scene 1, scene 2, scene 3, yes, no and stop."
11
 
 
 
 
 
 
 
12
  demo = gr.Blocks()
13
 
14
  def classify_audio(audio):
 
24
  inputs=gr.inputs.Audio(source="microphone", type="filepath", label="Record your audio"),
25
  outputs=gr.outputs.Label(),
26
  title=title,
27
+ theme="huggingface",
28
  description=description
29
  )
30
 
 
32
  fn=classify_audio,
33
  title=title,
34
  description=description,
35
+ inputs=gr.inputs.Audio(source="upload", optional=True, label="Audio file", type="filepath"),
36
+ theme="huggingface",
37
  outputs=gr.outputs.Label(),
38
  )
39