Skip to content

Commit

Permalink
fix tensors on different devices when deploying MiniCPM-V-2_6 with te…
Browse files Browse the repository at this point in the history
…nsor parallelism (#2454)

* fix pp

* fix lint
  • Loading branch information
irexyc authored Sep 12, 2024
1 parent edcdd8e commit 5d09bfd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lmdeploy/vl/model/minicpmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def build_model(self):
max_memory=self.max_memory,
checkpoint=self.model_path,
device_map='auto' if not self.with_llm else {'': 'cpu'},
no_split_module_classes=['Idefics2EncoderLayer', 'Resampler'],
no_split_module_classes=[
'Idefics2EncoderLayer', 'Resampler', 'SiglipEncoderLayer'
],
dtype=torch.half)

model.resampler.pos_embed = model.resampler.pos_embed.to(
Expand Down

0 comments on commit 5d09bfd

Please sign in to comment.