vince62s commited on
Commit
38b08d7
·
verified ·
1 Parent(s): def981e

Upload modelling_xlm_roberta.py

Browse files
Files changed (1) hide show
  1. modelling_xlm_roberta.py +3 -2
modelling_xlm_roberta.py CHANGED
@@ -1456,8 +1456,9 @@ class XLMRobertaForEstimation(XLMRobertaPreTrainedModel):
1456
  return_dict=return_dict,
1457
  )
1458
 
1459
- logits = self.estimator(outputs[0])
1460
- reshaped_logits = logits.view(-1, num_choices)
 
1461
 
1462
  loss = None
1463
  if labels is not None:
 
1456
  return_dict=return_dict,
1457
  )
1458
 
1459
+ CLS_tok = outputs[0][:, 0, :] # for some reason at sentence level we take the first token score cf Comet
1460
+ logits = self.estimator(CLS_tok)
1461
+ reshaped_logits = logits #.view(-1, num_choices)
1462
 
1463
  loss = None
1464
  if labels is not None: