Update modeling_deberta.py
Browse files- modeling_deberta.py +1 -1
modeling_deberta.py
CHANGED
@@ -1166,7 +1166,7 @@ class DebertaV2ForMaskedLM(DebertaV2PreTrainedModel):
|
|
1166 |
|
1167 |
encoding = tokenizer(sequence, add_special_tokens=False, return_tensors="pt")
|
1168 |
num_words = max(i for i in encoding.word_ids() if i is not None) + 1
|
1169 |
-
scored_mask = [i and i >= num_words - scored_length for i in encoding.word_ids()]
|
1170 |
num_to_score = sum(scored_mask)
|
1171 |
|
1172 |
tokens = encoding.input_ids.squeeze(0)
|
|
|
1166 |
|
1167 |
encoding = tokenizer(sequence, add_special_tokens=False, return_tensors="pt")
|
1168 |
num_words = max(i for i in encoding.word_ids() if i is not None) + 1
|
1169 |
+
scored_mask = [i is not None and i >= num_words - scored_length for i in encoding.word_ids()]
|
1170 |
num_to_score = sum(scored_mask)
|
1171 |
|
1172 |
tokens = encoding.input_ids.squeeze(0)
|