Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,9 +13,15 @@ labels = learner.dls.vocab
|
|
13 |
# Define a function to make predictions
|
14 |
def predict(text):
|
15 |
prediction = learner.predict(text)
|
16 |
-
|
17 |
pred, pred_idx, probs = prediction[:3]
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
# Create and launch the Gradio interface
|
21 |
gr.Interface(
|
|
|
13 |
# Define a function to make predictions
|
14 |
def predict(text):
|
15 |
prediction = learner.predict(text)
|
16 |
+
|
17 |
pred, pred_idx, probs = prediction[:3]
|
18 |
+
|
19 |
+
negative_label, positive_label = labels
|
20 |
+
|
21 |
+
return {
|
22 |
+
negative_label: float(probs[0]),
|
23 |
+
positive_label: float(probs[1])
|
24 |
+
}
|
25 |
|
26 |
# Create and launch the Gradio interface
|
27 |
gr.Interface(
|