Repository navigation
fix: preserve truncation direction in static tokenizer loader - #857
linhongyu510 wants to merge 1 commit into
Conversation
enable_truncation() resets the direction to right unless it is explicitly passed. Save the configured direction from the tokenizer before re-enabling truncation at MAX_LENGTH, then pass it through. Same bug class as qdrant#801 for the ColBERT loader. 7 regression tests covering left/right direction, tail/head truncation with 600 tokens, no-truncation default, no-padding, and save/reload roundtrip.
Walkthrough
Merge Risk:
|
enable_truncation() resets the direction to right unless it is explicitly passed. Save the configured direction from the tokenizer before re-enabling truncation at MAX_LENGTH, then pass it through. Same bug class as #801 for the ColBERT loader.
7 regression tests covering left/right direction, tail/head truncation with 600 tokens, no-truncation default, no-padding, and save/reload roundtrip.
All Submissions:
New Feature Submissions:
pre-commitwithpip3 install pre-commitand set up hooks withpre-commit install?New models submission: