Skip to content

Commit ef205dd

Browse files
committed
Hopefully this fixes MLM
1 parent c93b563 commit ef205dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

megatron/data/mlm_dataset.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,14 @@ def __init__(
297297
# according to `noise_density` and `mean_noise_span_length`. We can also define the label length accordingly.
298298
number_of_raw_tokens, inputs_length, targets_length, num_noise_spans = compute_input_and_target_lengths(
299299
# +1 is used so that we can compute the as autoregressive systems require us to add one more token.
300-
sequence_length=self.sequence_length + 1,
300+
sequence_length=self.sequence_length,
301301
noise_density=self.noise_density,
302302
mean_noise_span_length=self.mean_noise_span_length
303303
)
304-
self.number_of_raw_tokens = number_of_raw_tokens
305304
self.inputs_length = inputs_length
306-
self.targets_length = targets_length
305+
# As the loss we add a token at the end
306+
self.number_of_raw_tokens = number_of_raw_tokens + 1
307+
self.targets_length = targets_length +1
307308
self.num_noise_spans = num_noise_spans
308309

309310
# Build the samples mapping.

0 commit comments

Comments
 (0)