alaeddine-13
commited on
Commit
•
dd64d18
1
Parent(s):
e1b325c
add sliding window parameter to all layers
Browse files- modeling_bert.py +4 -0
modeling_bert.py
CHANGED
@@ -1510,6 +1510,7 @@ class JinaBertForPreTraining(JinaBertPreTrainedModel):
|
|
1510 |
output_attentions: Optional[bool] = None,
|
1511 |
output_hidden_states: Optional[bool] = None,
|
1512 |
return_dict: Optional[bool] = None,
|
|
|
1513 |
) -> Union[Tuple[torch.Tensor], JinaBertForPreTrainingOutput]:
|
1514 |
r"""
|
1515 |
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
@@ -1541,6 +1542,7 @@ class JinaBertForPreTraining(JinaBertPreTrainedModel):
|
|
1541 |
output_attentions=output_attentions,
|
1542 |
output_hidden_states=output_hidden_states,
|
1543 |
return_dict=return_dict,
|
|
|
1544 |
)
|
1545 |
|
1546 |
sequence_output, pooled_output = outputs[:2]
|
@@ -1783,6 +1785,7 @@ class JinaBertForMaskedLM(JinaBertPreTrainedModel):
|
|
1783 |
output_attentions: Optional[bool] = None,
|
1784 |
output_hidden_states: Optional[bool] = None,
|
1785 |
return_dict: Optional[bool] = None,
|
|
|
1786 |
) -> Union[Tuple[torch.Tensor], MaskedLMOutput]:
|
1787 |
r"""
|
1788 |
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
@@ -1807,6 +1810,7 @@ class JinaBertForMaskedLM(JinaBertPreTrainedModel):
|
|
1807 |
output_attentions=output_attentions,
|
1808 |
output_hidden_states=output_hidden_states,
|
1809 |
return_dict=return_dict,
|
|
|
1810 |
)
|
1811 |
|
1812 |
sequence_output = outputs[0]
|
|
|
1510 |
output_attentions: Optional[bool] = None,
|
1511 |
output_hidden_states: Optional[bool] = None,
|
1512 |
return_dict: Optional[bool] = None,
|
1513 |
+
sliding_window: Optional[int] = None,
|
1514 |
) -> Union[Tuple[torch.Tensor], JinaBertForPreTrainingOutput]:
|
1515 |
r"""
|
1516 |
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
|
|
1542 |
output_attentions=output_attentions,
|
1543 |
output_hidden_states=output_hidden_states,
|
1544 |
return_dict=return_dict,
|
1545 |
+
sliding_window=sliding_window
|
1546 |
)
|
1547 |
|
1548 |
sequence_output, pooled_output = outputs[:2]
|
|
|
1785 |
output_attentions: Optional[bool] = None,
|
1786 |
output_hidden_states: Optional[bool] = None,
|
1787 |
return_dict: Optional[bool] = None,
|
1788 |
+
sliding_window: Optional[int] = None,
|
1789 |
) -> Union[Tuple[torch.Tensor], MaskedLMOutput]:
|
1790 |
r"""
|
1791 |
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
|
|
1810 |
output_attentions=output_attentions,
|
1811 |
output_hidden_states=output_hidden_states,
|
1812 |
return_dict=return_dict,
|
1813 |
+
sliding_window=sliding_window
|
1814 |
)
|
1815 |
|
1816 |
sequence_output = outputs[0]
|