davda54 commited on
Commit
f75a95e
1 Parent(s): d0efb80

Update modeling_norbert.py

Browse files
Files changed (1) hide show
  1. modeling_norbert.py +8 -2
modeling_norbert.py CHANGED
@@ -329,6 +329,7 @@ class NorbertModel(NorbertPreTrainedModel):
329
  output_hidden_states: Optional[bool] = None,
330
  output_attentions: Optional[bool] = None,
331
  return_dict: Optional[bool] = None,
 
332
  ) -> Union[Tuple[torch.Tensor], BaseModelOutput]:
333
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
334
 
@@ -370,6 +371,7 @@ class NorbertForMaskedLM(NorbertModel):
370
  output_attentions: Optional[bool] = None,
371
  return_dict: Optional[bool] = None,
372
  labels: Optional[torch.LongTensor] = None,
 
373
  ) -> Union[Tuple[torch.Tensor], MaskedLMOutput]:
374
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
375
 
@@ -446,6 +448,7 @@ class NorbertForSequenceClassification(NorbertModel):
446
  output_hidden_states: Optional[bool] = None,
447
  return_dict: Optional[bool] = None,
448
  labels: Optional[torch.LongTensor] = None,
 
449
  ) -> Union[Tuple[torch.Tensor], SequenceClassifierOutput]:
450
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
451
 
@@ -511,6 +514,7 @@ class NorbertForTokenClassification(NorbertModel):
511
  output_hidden_states: Optional[bool] = None,
512
  return_dict: Optional[bool] = None,
513
  labels: Optional[torch.LongTensor] = None,
 
514
  ) -> Union[Tuple[torch.Tensor], TokenClassifierOutput]:
515
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
516
 
@@ -558,7 +562,8 @@ class NorbertForQuestionAnswering(NorbertModel):
558
  output_hidden_states: Optional[bool] = None,
559
  return_dict: Optional[bool] = None,
560
  start_positions: Optional[torch.Tensor] = None,
561
- end_positions: Optional[torch.Tensor] = None
 
562
  ) -> Union[Tuple[torch.Tensor], QuestionAnsweringModelOutput]:
563
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
564
 
@@ -624,7 +629,8 @@ class NorbertForMultipleChoice(NorbertModel):
624
  labels: Optional[torch.Tensor] = None,
625
  output_attentions: Optional[bool] = None,
626
  output_hidden_states: Optional[bool] = None,
627
- return_dict: Optional[bool] = None
 
628
  ) -> Union[Tuple[torch.Tensor], MultipleChoiceModelOutput]:
629
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
630
  num_choices = input_ids.shape[1]
 
329
  output_hidden_states: Optional[bool] = None,
330
  output_attentions: Optional[bool] = None,
331
  return_dict: Optional[bool] = None,
332
+ **kwargs
333
  ) -> Union[Tuple[torch.Tensor], BaseModelOutput]:
334
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
335
 
 
371
  output_attentions: Optional[bool] = None,
372
  return_dict: Optional[bool] = None,
373
  labels: Optional[torch.LongTensor] = None,
374
+ **kwargs
375
  ) -> Union[Tuple[torch.Tensor], MaskedLMOutput]:
376
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
377
 
 
448
  output_hidden_states: Optional[bool] = None,
449
  return_dict: Optional[bool] = None,
450
  labels: Optional[torch.LongTensor] = None,
451
+ **kwargs
452
  ) -> Union[Tuple[torch.Tensor], SequenceClassifierOutput]:
453
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
454
 
 
514
  output_hidden_states: Optional[bool] = None,
515
  return_dict: Optional[bool] = None,
516
  labels: Optional[torch.LongTensor] = None,
517
+ **kwargs
518
  ) -> Union[Tuple[torch.Tensor], TokenClassifierOutput]:
519
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
520
 
 
562
  output_hidden_states: Optional[bool] = None,
563
  return_dict: Optional[bool] = None,
564
  start_positions: Optional[torch.Tensor] = None,
565
+ end_positions: Optional[torch.Tensor] = None,
566
+ **kwargs
567
  ) -> Union[Tuple[torch.Tensor], QuestionAnsweringModelOutput]:
568
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
569
 
 
629
  labels: Optional[torch.Tensor] = None,
630
  output_attentions: Optional[bool] = None,
631
  output_hidden_states: Optional[bool] = None,
632
+ return_dict: Optional[bool] = None,
633
+ **kwargs
634
  ) -> Union[Tuple[torch.Tensor], MultipleChoiceModelOutput]:
635
  return_dict = return_dict if return_dict is not None else self.config.use_return_dict
636
  num_choices = input_ids.shape[1]