__all__ = ['learn', 'classicy_image', 'categories', 'image', 'label', 'examples', 'intf'] from fastai.vision.all import * import gradio as gr learn = load_learner('mnist_model.pkl') def classify_image(img): pred,idx,probs = learn.predict(img) return pred image = gr.Image(width=192, height=192) label = gr.Label() examples = ["5.png"] #intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples) intf = gr.Interface(fn=classify_image, inputs=image, outputs=label) intf.launch(inline=False)