ilyshi commited on
Commit
2421d35
1 Parent(s): 8fff14d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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("Predictions:")
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