Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why there is no padding or truncation based on max length #9

Open
PrAsAnNaRePo opened this issue Oct 9, 2024 · 1 comment
Open

Comments

@PrAsAnNaRePo
Copy link

No description provided.

@zhangfaen
Copy link
Owner

In the finetune.py, there is:
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", min_pixels=2562828, max_pixels=5122828, padding_side="right")

It means we set padding strategy, it's behavior is add padding tokens to the shorter data sample in the batch to match the longest of data sample in the batch.

See https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_fast.py#L82 for more details.

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

No branches or pull requests

2 participants