import gradio as gr from huggingface_hub import from_pretrained_fastai repo_id = "triskuit/bears" learner = from_pretrained_fastai(repo_id) categories = ("black", "grizzly", "teddy") def classify_image(img): pred,idx,probs = learner.predict(img) return dict(zip(categories, map(float, probs))) demo = gr.Interface(fn=classify_image, inputs="image", outputs="label") demo.launch()