feat: implement batch tokenization for TokenizeManager#117
Conversation
Alise-svg
commented
Apr 19, 2026
- Use tokenizer() for batch encoding plain texts
- Use apply_chat_template() for batch processing chat templates
- Remove padding tokens using attention mask
- Preserve original message order
- Add comprehensive unit tests for batch tokenization
|
Benchmark Description Objective Compare the performance of batch tokenization versus individual tokenization. Methodology
Batch tokenization significantly improves throughput in high-concurrency scenarios. |
a4fa5b6 to
add3d38
Compare
|
Thanks for your contribution @Alise-svg . Might be a duplicate of #55. Could you take a look at that PR and compare with that? |
- Use tokenizer() for batch encoding plain texts - Use apply_chat_template() for batch processing chat templates - Remove padding tokens using attention mask - Preserve original message order - Add comprehensive unit tests for batch tokenization
add3d38 to
48047df
Compare
|
@DarkSharpness |
