demo1 / app.py
jahnavib26's picture
Update app.py
6b6debc verified
raw
history blame contribute delete
582 Bytes
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()