Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,9 @@ labels = learner.dls.vocab
|
|
12 |
|
13 |
# Define a function to make predictions
|
14 |
def predict(text):
|
15 |
-
|
|
|
|
|
16 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
17 |
|
18 |
# Create and launch the Gradio interface
|
|
|
12 |
|
13 |
# Define a function to make predictions
|
14 |
def predict(text):
|
15 |
+
prediction = learner.predict(text)
|
16 |
+
print(prediction)
|
17 |
+
pred, pred_idx, probs = prediction[:3]
|
18 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
19 |
|
20 |
# Create and launch the Gradio interface
|