Skip to content

fix: count literal special-token spellings in chunk text - #461

Open
jackiectl2 wants to merge 1 commit into
StarTrail-org:mainfrom
jackiectl2:fix-literal-special-token-text
Open

jackiectl2 wants to merge 1 commit into
StarTrail-org:mainfrom
jackiectl2:fix-literal-special-token-text

Conversation

@jackiectl2

Copy link
Copy Markdown
Contributor

What does this PR do?

Encode corpus text with special-token rejection disabled in both token estimation and truncation. Literal strings such as <|endoftext|> in documents are ordinary content, not tokenizer control tokens.

Validation

3 regressions passed and fail on the base; Ruff checks passed. Tests use a real deterministic tiktoken encoder with a small byte vocabulary to remain offline.

The default cl100k_base vocabulary download was blocked by the environment; no embedding/model run was performed.

Checklist

  • Focused regression tests pass.
  • Changed files pass Ruff.
  • Full tests and all pre-commit hooks (not run).

Signed-off-by: Tianlang (Jackie) Chen <305351710+jackiectl2@users.noreply.github.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