Skip to content

fix: whitespace tokenizer uses findall for token count#309

Open
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/whitespace-tokenizer-findall
Open

fix: whitespace tokenizer uses findall for token count#309
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/whitespace-tokenizer-findall

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • WhitespaceLengthV1 used split() on a token-matching regex → N+1 overcount.
  • Use findall() (same as RedPajama code tagger).

Test plan

  • "hello world" → 2; "a" → 1; "" → 0

Made with Cursor

split() overcounts (N+1); match RedPajama tagger / token regex semantics.

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.

1 participant