Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # Carregar o modelo diretamente do Hugging Face Hub | |
| classifier = pipeline("image-classification", model="mestrevh/computer-vision-cifar-10") | |
| # Função de classificação | |
| def predict_image(image): | |
| return classifier(image) | |
| # Interface Gradio | |
| interface = gr.Interface(fn=predict_image, | |
| inputs=gr.inputs.Image(type="pil"), | |
| outputs="label", | |
| live=True) | |
| interface.launch() | |