jwalanthi commited on
Commit
f2e3727
·
1 Parent(s): bfab9b8
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,8 +36,9 @@ def predict (Sentence, Word, LLM, Norm, Layer):
36
  data = (Sentence, Word)
37
  emb = lm.extract_representation(data, layer=Layer)
38
  pred = torch.nn.functional.relu(model(emb))
39
- pred = pred.squeeze(0)
40
- pred_list = pred.detach().numpy().tolist()
 
41
 
42
  df = pd.DataFrame({'feature':labels, 'value':pred_list})
43
  df = df[df['value'] > 0]
 
36
  data = (Sentence, Word)
37
  emb = lm.extract_representation(data, layer=Layer)
38
  pred = torch.nn.functional.relu(model(emb))
39
+ pred_sq = pred.squeeze(0)
40
+ pred_round = torch.round(pred_sq, decimals=2)
41
+ pred_list = pred_round.detach().numpy().tolist()
42
 
43
  df = pd.DataFrame({'feature':labels, 'value':pred_list})
44
  df = df[df['value'] > 0]