Spaces:
Runtime error
Runtime error
from fastai.vision.all import * | |
import gradio as gr | |
learner = load_learner('model.pkl') | |
def predict_genre(img): | |
pred, idx, probs = learner.predict(img) | |
return dict(zip(learner.dls.vocab, map(float, probs))) | |
demo = gr.Interface(fn=predict_genre, inputs="image", outputs="label") | |
demo.launch() |