Spaces:
Sleeping
Sleeping
updated output labels
Browse files
app.py
CHANGED
@@ -20,7 +20,8 @@ A worker was using a grinder in a confined space when he became dizzy from the f
|
|
20 |
|
21 |
def predict(txt):
|
22 |
pred,_,probs = learn.predict(txt)
|
23 |
-
return {labels[i]: float(probs[i]) for i in range(
|
|
|
24 |
#return learn.predict(txt)
|
25 |
# formating of return f"Rating: {pred} prob: float(probs[pred_idx[i]]"
|
26 |
#return f'{pred}'
|
|
|
20 |
|
21 |
def predict(txt):
|
22 |
pred,_,probs = learn.predict(txt)
|
23 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
24 |
+
# return {labels[i]: float(probs[i]) for i in range(1)}
|
25 |
#return learn.predict(txt)
|
26 |
# formating of return f"Rating: {pred} prob: float(probs[pred_idx[i]]"
|
27 |
#return f'{pred}'
|