Spaces:
Running
Running
rounding
Browse files
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 |
-
|
40 |
-
|
|
|
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]
|