Skip to content

Refactor Trainer and pretokenization interface#1287

Open
taku910 wants to merge 2 commits into
masterfrom
trainer
Open

Refactor Trainer and pretokenization interface#1287
taku910 wants to merge 2 commits into
masterfrom
trainer

Conversation

@taku910

@taku910 taku910 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Refactor Trainer and pretokenization interface

- Defined pretokenizer as std::function<std::vector<std::string>(absl::string_view)> and enabled setting custom callbacks via Python API.
- Unified pretokenization boundary enforcement (delimiter and callback) via 0x001F in LoadSentences.
- Refactored sentence normalization in LoadSentences to use RunBatch for dynamic load-balancing.
- Applied Pimpl pattern to TrainerComponents to eliminate sentencepiece_model.pb.h include from sentencepiece_trainer.h.
- Enforced mutual exclusivity between pretokenizer callback and pretokenization_delimiter in VerifySpec.
- Removed obsolete pretokenizer_for_training files and updated documentation.

@taku910
taku910 force-pushed the trainer branch 8 times, most recently from fd00d50 to d9c1521 Compare July 18, 2026 04:38
- Defined pretokenizer as std::function<std::vector<std::string>(absl::string_view)> and enabled setting custom callbacks via Python API.
- Unified pretokenization boundary enforcement (delimiter and callback) via 0x001F in LoadSentences.
- Refactored sentence normalization in LoadSentences to use RunBatch for dynamic load-balancing.
- Applied Pimpl pattern to TrainerComponents to eliminate sentencepiece_model.pb.h include from sentencepiece_trainer.h.
- Enforced mutual exclusivity between pretokenizer callback and pretokenization_delimiter in VerifySpec.
- Removed obsolete pretokenizer_for_training files and updated documentation.

TAG=agy
CONV=d3ccf372-3c94-4e30-81f2-fedd43ab6bcb
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