Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,12 @@ import gradio as gr
|
|
3 |
|
4 |
learn.load_learner('export.pkl')
|
5 |
|
6 |
-
categories
|
7 |
label = gr.outputs.Label()
|
8 |
def classify(text):
|
9 |
pred,pred_idx,probs = learn.predict(text)
|
10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
|
12 |
|
13 |
-
intf = gr.Interface(
|
|
|
|
3 |
|
4 |
learn.load_learner('export.pkl')
|
5 |
|
6 |
+
categories = ('Negative', 'Positive')
|
7 |
label = gr.outputs.Label()
|
8 |
def classify(text):
|
9 |
pred,pred_idx,probs = learn.predict(text)
|
10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
|
12 |
|
13 |
+
intf = gr.Interface(classify,"text",label)
|
14 |
+
intf.launch()
|