jahnavib26 commited on
Commit
6b6debc
·
verified ·
1 Parent(s): 36cd2f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -10,14 +10,14 @@ pipe = pipeline(
10
  chunk_length_s=30,
11
  device=device,
12
  )
 
13
 
14
- ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
15
- sample = ds[0]["audio"]
16
-
17
- prediction = pipe(sample.copy(), batch_size=8)["text"]
18
- " Mr. Quilter is the apostle of the middle classes, and we are glad to welcome his gospel."
 
19
 
20
- # we can also return timestamps for the predictions
21
- prediction = pipe(sample.copy(), batch_size=8, return_timestamps=True)["chunks"]
22
- [{'text': ' Mr. Quilter is the apostle of the middle classes and we are glad to welcome his gospel.',
23
- 'timestamp': (0.0, 5.44)}]
 
10
  chunk_length_s=30,
11
  device=device,
12
  )
13
+
14
 
15
+ gradio_app = gr.Interface(
16
+ predict,
17
+ inputs=gr.Audio(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
18
+ outputs=[gr. Audio(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
19
+ title="Hot Dog? Or Not?",
20
+ )
21
 
22
+ if __name__ == "__main__":
23
+ gradio_app.launch()