| import gradio as gr | |
| from huggingface_hub import from_pretrained_fastai | |
| learner = from_pretrained_fastai("hdchild/bear") | |
| def predict(image): | |
| return learner.predict(image)[0] | |
| iface = gr.Interface(fn=predict, inputs="image", outputs="text", capture_session=True) | |
| iface.launch() |