sergeyfeldman commited on
Commit
ae0b04d
·
1 Parent(s): 46bb59f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,7 +13,8 @@ all_label_names = list(model.config.id2label.values())
13
 
14
  def predict(text):
15
  probs = expit(model(**tokenizer([text], return_tensors="pt", padding=True)).logits.detach().numpy())
16
- return {i: np.round(j, 2) for i, j in zip(all_label_names, probs[0])}
 
17
 
18
  iface = gr.Interface(
19
  fn=predict,
 
13
 
14
  def predict(text):
15
  probs = expit(model(**tokenizer([text], return_tensors="pt", padding=True)).logits.detach().numpy())
16
+ print(probs.shape, probs[0].shape)
17
+ return {i: np.round(j, 2) for i, j in zip(all_label_names, probs)}
18
 
19
  iface = gr.Interface(
20
  fn=predict,