Aye10032 commited on
Commit
629cd1c
·
1 Parent(s): 1d6fdc1
Files changed (1) hide show
  1. loss_metric.py +3 -2
loss_metric.py CHANGED
@@ -51,7 +51,7 @@ Examples:
51
 
52
 
53
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
54
- class loss_metric(evaluate.Metric):
55
  """Calculation of the cross-entropy loss function using the huggingface evaluate module."""
56
 
57
  def _info(self):
@@ -73,8 +73,9 @@ class loss_metric(evaluate.Metric):
73
  reference_urls=["http://path.to.reference.url/new_module"]
74
  )
75
 
76
- def _compute(self, predictions: Tensor, references: Tensor):
77
  """Returns the scores"""
 
78
  loss_func = nn.CrossEntropyLoss()
79
  loss = loss_func(predictions, references)
80
 
 
51
 
52
 
53
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
54
+ class LossMetric(evaluate.Metric):
55
  """Calculation of the cross-entropy loss function using the huggingface evaluate module."""
56
 
57
  def _info(self):
 
73
  reference_urls=["http://path.to.reference.url/new_module"]
74
  )
75
 
76
+ def _compute(self, predictions, references):
77
  """Returns the scores"""
78
+ print(predictions)
79
  loss_func = nn.CrossEntropyLoss()
80
  loss = loss_func(predictions, references)
81