File size: 582 Bytes
c97654c
b09aad8
c97654c
 
 
 
 
 
 
 
 
 
6b6debc
64812af
6b6debc
 
 
 
 
 
64812af
6b6debc
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import torch
from transformers import pipeline
from datasets import load_dataset

device = "cuda:0" if torch.cuda.is_available() else "cpu"

pipe = pipeline(
  "automatic-speech-recognition",
  model="openai/whisper-small",
  chunk_length_s=30,
  device=device,
)
 

gradio_app = gr.Interface(
    predict,
    inputs=gr.Audio(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
    outputs=[gr. Audio(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
    title="Hot Dog? Or Not?",
)

if __name__ == "__main__":
    gradio_app.launch()