Update modeling_deberta.py
Browse files- modeling_deberta.py +15 -0
modeling_deberta.py
CHANGED
|
@@ -1100,6 +1100,8 @@ class DebertaV2ForMaskedLM(DebertaV2PreTrainedModel):
|
|
| 1100 |
self.deberta = DebertaV2Model(config)
|
| 1101 |
self.cls = DebertaV2OnlyMLMHead(config)
|
| 1102 |
|
|
|
|
|
|
|
| 1103 |
# Initialize weights and apply final processing
|
| 1104 |
self.post_init()
|
| 1105 |
|
|
@@ -1130,6 +1132,19 @@ class DebertaV2ForMaskedLM(DebertaV2PreTrainedModel):
|
|
| 1130 |
|
| 1131 |
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 1132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1133 |
outputs = self.deberta(
|
| 1134 |
input_ids,
|
| 1135 |
attention_mask=attention_mask,
|
|
|
|
| 1100 |
self.deberta = DebertaV2Model(config)
|
| 1101 |
self.cls = DebertaV2OnlyMLMHead(config)
|
| 1102 |
|
| 1103 |
+
self.verbose = False
|
| 1104 |
+
|
| 1105 |
# Initialize weights and apply final processing
|
| 1106 |
self.post_init()
|
| 1107 |
|
|
|
|
| 1132 |
|
| 1133 |
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 1134 |
|
| 1135 |
+
if self.verbose:
|
| 1136 |
+
for i in input_ids[0, :].tolist():
|
| 1137 |
+
print(i, end=", ")
|
| 1138 |
+
print()
|
| 1139 |
+
if attention_mask is not None:
|
| 1140 |
+
for i in attention_mask[0, :].tolist():
|
| 1141 |
+
print(i, end=", ")
|
| 1142 |
+
print()
|
| 1143 |
+
if position_ids is not None:
|
| 1144 |
+
for i in position_ids[0, :].tolist():
|
| 1145 |
+
print(i, end=", ")
|
| 1146 |
+
print()
|
| 1147 |
+
|
| 1148 |
outputs = self.deberta(
|
| 1149 |
input_ids,
|
| 1150 |
attention_mask=attention_mask,
|