import gradio as gr from transformers import pipeline classifier = pipeline("image-classification", model="deomdell/Bhutanese-religious-artefacts-model") import numpy as np def image_classifier(inp): confidence_scores = np.random.rand(7) confidence_scores /= np.sum(confidence_scores) classes = ['chem', 'cymbal', 'dorji', 'drilbu', 'dungkar', 'maney', 'phurpa'] result = {classes[i]:confidence_scores[i] for i in range(7)} return result demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label") demo.launch(share=True)