Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def print_probs(logits):
|
|
15 |
i = 0
|
16 |
while sum <= 95:
|
17 |
prob, idx = ans[i]
|
18 |
-
text = categories[idx] + ": "+ str(np.round(prob,1))
|
19 |
st.markdown(text)
|
20 |
sum+=prob
|
21 |
i+=1
|
@@ -24,7 +24,7 @@ def make_prediction(text):
|
|
24 |
tokenized_text = tokenizer(text, return_tensors='pt')
|
25 |
with torch.no_grad():
|
26 |
pred_logits = model(**tokenized_text).logits
|
27 |
-
st.markdown("
|
28 |
print_probs(pred_logits[0])
|
29 |
|
30 |
|
|
|
15 |
i = 0
|
16 |
while sum <= 95:
|
17 |
prob, idx = ans[i]
|
18 |
+
text = categories[idx] + ": "+ str(np.round(prob,1)) + "%"
|
19 |
st.markdown(text)
|
20 |
sum+=prob
|
21 |
i+=1
|
|
|
24 |
tokenized_text = tokenizer(text, return_tensors='pt')
|
25 |
with torch.no_grad():
|
26 |
pred_logits = model(**tokenized_text).logits
|
27 |
+
st.markdown("Category probability:")
|
28 |
print_probs(pred_logits[0])
|
29 |
|
30 |
|