Spaces:
Running
Running
try diff format
Browse files- cross_entropy_loss.py +2 -2
cross_entropy_loss.py
CHANGED
@@ -63,8 +63,8 @@ class cross_entropy_loss(evaluate.Metric):
|
|
63 |
def _compute(self, prediction_scores, references):
|
64 |
"""Returns the scores"""
|
65 |
|
66 |
-
loss = F.cross_entropy(input=torch.
|
67 |
-
target=torch.
|
68 |
ignore_index=-100).item()
|
69 |
return {
|
70 |
"cross_entropy_loss": loss
|
|
|
63 |
def _compute(self, prediction_scores, references):
|
64 |
"""Returns the scores"""
|
65 |
|
66 |
+
loss = F.cross_entropy(input=torch.tensor(prediction_scores),
|
67 |
+
target=torch.tensor(references),
|
68 |
ignore_index=-100).item()
|
69 |
return {
|
70 |
"cross_entropy_loss": loss
|