from fastai.vision.all import * | |
import gradio as gr | |
learn = load_learner('export (1).pkl') | |
def predict(frase): | |
pred, pred_idx, probs = learn.predict(frase) | |
return {labels[i]: float(probs[i]) for i in range(len(labels))} | |
gr.Interface(fn=predict, outputs=gr.outputs.Label(num_top_classes=5), examples=['frase1.txt','frase2.txt2']).launch(share=False) |