Spaces:
Runtime error
Runtime error
ariana sutanto commited on
Commit ·
fe665ce
1
Parent(s): 1bf7c6f
message
Browse files
app.py
CHANGED
|
@@ -40,13 +40,14 @@ def get_score(abstract):
|
|
| 40 |
print(logits)
|
| 41 |
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
#return #accept_prob
|
| 52 |
|
|
|
|
| 40 |
print(logits)
|
| 41 |
|
| 42 |
|
| 43 |
+
outputs = model(inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
| 44 |
+
scores = torch.softmax(outputs.logits, dim=1)[0]
|
| 45 |
+
print(scores)
|
| 46 |
+
probs = F.softmax(scores, dim=0)
|
| 47 |
+
print(probs)
|
| 48 |
+
accept_prob = probs[0].item()
|
| 49 |
+
|
| 50 |
+
print(accept_prob)
|
| 51 |
|
| 52 |
#return #accept_prob
|
| 53 |
|