File size: 456 Bytes
d33ca2a
 
 
84784be
 
 
 
241566e
 
84784be
 
2c158de
84784be
8aa4824
f613127
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fastai.text.all import *
import pandas as pd
from datasets import load_dataset
import gradio as gr

learn = load_learner('export (1).pkl')

labels = learn.dls.vocab

def predict(frase):
    pred, pred_idx, probs = learn.predict(frase)
    return pred
    
 gr.Interface(fn=predict, inputs="text", outputs="text", examples=['im feeling rather rotten so im not very ambitious right now','im updating my blog because i feel shitty
']).launch(share=False)