[Fix] Allow InternVL to skip dynamic preprocessing - #4828
Open
zcxGGmu wants to merge 1 commit into
Open
Conversation
Signed-off-by: zq <zhouquan1511@163.com>
Collaborator
|
STOP pull new request until fixing the previous ones. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Issue #3778 asks how to avoid InternVL's internal dynamic resize/splitting when the application needs a stable mapping back to a prepared image, e.g. grounding coordinates.
Refs #3778
Modification
skip_preprocess=Truesupport for the legacy InternVL dynamic image preprocessing path.dynamic_preprocess(...)and applies the existing model transform to the original image as a single patch.max_dynamic_patchandskip_preprocessin the English and Chinese InternVL docs.skip_preprocess=Truestill callsdynamic_preprocess.BC-breaking (Optional)
No. The default preprocessing path is unchanged.
Use cases (Optional)
Checklist
PYTHONPATH= python -m pre_commit run --files lmdeploy/vl/model/internvl.py tests/test_lmdeploy/test_vl/test_internvl_preprocess.py docs/en/multi_modal/internvl.md docs/zh_cn/multi_modal/internvl.mdpython -m pytest tests/test_lmdeploy/test_vl/test_internvl_preprocess.py -qdocs/en/multi_modal/internvl.mdanddocs/zh_cn/multi_modal/internvl.md.