first_space / app.py
CDStefan's picture
Update app.py
208de4a
raw
history blame contribute delete
No virus
354 Bytes
!pip install huggingface_hub["fastai"]
import gradio as gr
import fastai*
learn = load_learner(path/'export.pkl')
def image_classifier(inp):
pred, pred_idx, probs = learn.predict(inp)
label = f'Prediction: {pred}; Probability: {probs[pred_idx]:.04f}'
return label
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()