Skip to content

Commit

Permalink
yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyding committed Sep 16, 2024
1 parent 1977c0b commit 103db99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llmfoundry/command_utils/data_prep/convert_text_to_mds.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,10 @@ def __iter__(self) -> Iterable[dict[str, NDArray]]:
buffer += iids
while len(buffer) >= self.max_length:
concat_sample = buffer[:self.max_length]
buffer = buffer[self.max_length:
] if self.should_wrap else []
buffer = buffer[self.
max_length:] if self.should_wrap else []
yield {
'tokens':
np.asarray(concat_sample, dtype=np.int32),
'tokens': np.asarray(concat_sample, dtype=np.int32),
}

first_chunk = False
Expand Down

0 comments on commit 103db99

Please sign in to comment.