fix(merge_model): use torch_dtype for MLCDVisionModel and remove invalid device_map from CLIPImageProcessor#104
Open
inigopm wants to merge 1 commit into
Conversation
…lid device_map from CLIPImageProcessor CLIPImageProcessor is a processor, not a model — device_map is not a valid argument and raises TypeError at runtime. MLCDVisionModel.from_pretrained should use torch_dtype= (not dtype=) to explicitly set float32. Regression introduced in EvolvingLMMs-Lab#52, partially addressed in EvolvingLMMs-Lab#88.
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.
Problem
Two bugs in
validate_vit_consistency()introduced by #52 and only partially addressed in #88:MLCDVisionModel.from_pretrained— missingtorch_dtype=torch.float32. The original code usedtorch_dtype=correctly; refactor(merge_model): Enhanced file implementation robustness #52 changed it todtype=(silently ignored byfrom_pretrained); Update merge_model.py #88 removed the param entirely, losing the explicit float32 cast.CLIPImageProcessor.from_pretrained— still hasdevice_map=...after Update merge_model.py #88.CLIPImageProcessoris aProcessorMixin, not aPreTrainedModel;device_mapis not a valid argument and raisesTypeErrorat runtime.Fix