Spaces:
Runtime error
Runtime error
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() |