NickHerrig's picture
Add model weights, update gradio app
bd16a43 unverified
raw
history blame
361 Bytes
import gradio as gr
from fastai.vision.all import *
learn = load_learner("model_weights.pth")
def predict(image):
drink, _, probs = learn.predict(image)
probability = max(list(map(float, probs)))
return f"this is most likely a {drink} with probability {probability}."
demo = gr.Interface(fn=predict, inputs="image", outputs="text")
demo.launch()