Skip to content

Commit

Permalink
fix llava
Browse files Browse the repository at this point in the history
  • Loading branch information
grimoire committed Dec 10, 2024
1 parent 88f99d4 commit 92b09d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
26 changes: 0 additions & 26 deletions lmdeploy/pytorch/configurations/llava.py

This file was deleted.

3 changes: 3 additions & 0 deletions lmdeploy/pytorch/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,9 @@ async def _async_loop_preprocess_message(self, inque, outque):
req_data = req.data
if req_data.get('input_multimodals', None) is None:
continue
elif self.input_processor is None:
logger.warning('Do not support Multimodal inputs.')
continue
input_ids = req_data['token_ids']
input_multimodals = req_data['input_multimodals']
if len(input_multimodals) == 0:
Expand Down
3 changes: 2 additions & 1 deletion lmdeploy/pytorch/models/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,8 @@ def prepare_inputs_for_generation(
if len(img_mms) > 0:
image_token_id = img_mms[0].meta['image_token_id']
image_mask = input_ids == image_token_id
pixel_values = torch.cat([data.data for data in img_mms])
pixel_values = torch.cat(
[data.data.flatten(0, 1) for data in img_mms])
image_sizes = torch.cat(
[data.meta['image_sizes'] for data in img_mms])
else:
Expand Down
4 changes: 2 additions & 2 deletions lmdeploy/pytorch/supported_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
# cogvlm-chat
CogVLMForCausalLM=True,
# llava
LlavaLlamaForCausalLM=True,
LlavaLlamaForCausalLM=False,
# llava mistral
LlavaMistralForCausalLM=True,
LlavaMistralForCausalLM=False,
# deepseekvl
MultiModalityCausalLM=False,
# StarCoder2
Expand Down

0 comments on commit 92b09d0

Please sign in to comment.