update qwen-image default tokenizer_max_length#1041
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Qwen25_VLForConditionalGeneration_TextEncoder to allow a configurable tokenizer_max_length with a default of 4096, replacing the previous hardcoded value of 1024. Feedback indicates that this configuration is currently only applied to the text-only encoding path and should be extended to the image-to-image (i2i) task to ensure consistent truncation behavior and memory usage across all encoding paths.
| def __init__(self, config): | ||
| self.config = config | ||
| self.tokenizer_max_length = 1024 | ||
| self.tokenizer_max_length = config.get("tokenizer_max_length", 4096) |
There was a problem hiding this comment.
The tokenizer_max_length configuration is currently only applied to the text-only encoding path (line 221). The processor call used for the i2i task (line 202) does not utilize this parameter, which leads to inconsistent truncation behavior between tasks. If a user configures a specific max length, it should ideally be respected across all encoding paths to ensure predictable behavior and memory usage.
No description provided.