Skip to content

Commit

Permalink
iterate
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Wang <[email protected]>
  • Loading branch information
ywang96 committed Dec 8, 2024
1 parent fbf9cd0 commit 8d1d80e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vllm/model_executor/models/internvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,12 @@ def forward(
"intermediate_tensors": intermediate_tensors,
"inputs_embeds": inputs_embeds,
}
if self.img_context_token_id is not None:
visual_token_mask = self._get_visual_token_mask(input_ids)

if self.is_mono:
forward_kwargs.update({"visual_token_mask": visual_token_mask})
# Only required if the model is mono-architecture
if self.visual_token_mask is not None:
forward_kwargs.update(
{"visual_token_mask": self.visual_token_mask})
self.visual_token_mask = None

hidden_states = self.language_model.model(**forward_kwargs)
return hidden_states
Expand Down

0 comments on commit 8d1d80e

Please sign in to comment.