Skip to content

fix(tokenizer): honor max_size bytes and default files_per_process#303

Open
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/272-files-per-process-default
Open

fix(tokenizer): honor max_size bytes and default files_per_process#303
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/272-files-per-process-default

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • Default files_per_process to 1 to match documented tokenization behavior
  • Convert max_size (bytes) to memmap token capacity using the configured dtype width
  • Write tokens[start:end] consistently in MemmapWriter and error on sequences larger than a memmap file
  • Add a guard against unbounded memmap rollover loops

Fixes #272

Test plan

  • Run dolma tokens on a small sample with --processes 2 --files_per_process 1 and confirm output file count matches expectations
  • Tokenize a long document with --max_size set and verify memmap files respect the byte limit

Made with Cursor

- Default files_per_process to 1 to match documented behavior
- Convert max_size bytes to memmap token capacity by dtype width
- Write token slices consistently and fail on oversized sequences
- Guard against unbounded memmap rollover loops

Fixes allenai#272

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unlimited Generation During Tokenization

1 participant