mirari commited on
Commit
84784be
1 Parent(s): f038ef7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+
4
+ learn = load_learner('export (1).pkl')
5
+
6
+ def predict(frase):
7
+ pred, pred_idx, probs = learn.predict(frase)
8
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
9
+
10
+ gr.Interface(fn=predict, outputs=gr.outputs.Label(num_top_classes=5), examples=['frase1.txt','frase2.txt2']).launch(share=False)