jwalanthi commited on
Commit
a227eaa
·
1 Parent(s): d2572ec
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -35,7 +35,8 @@ def predict (Sentence, Word, LLM, Norm, Layer):
35
 
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()
 
35
 
36
  data = (Sentence, Word)
37
  emb = lm.extract_representation(data, layer=Layer)
38
+ with torch.no_grad:
39
+ pred = torch.nn.functional.relu(model(emb))
40
  pred_sq = pred.squeeze(0)
41
  pred_round = torch.round(pred_sq, decimals=2)
42
  pred_list = pred_round.detach().numpy().tolist()