Skip to content

Commit

Permalink
Fix image aspect ration in gen kwargs for llava one vision
Browse files Browse the repository at this point in the history
  • Loading branch information
kcz358 committed Jun 14, 2024
1 parent db3c403 commit f4eeaa9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lmms_eval/models/llava_onevision.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ def _collate(x):

# These steps are not in LLaVA's original code, but are necessary for generation to work
# TODO: attention to this major generation step...
if "image_aspect_ratio" in gen_kwargs.keys():
gen_kwargs.pop("image_aspect_ratio")
try:
with torch.inference_mode():
cont = self.model.generate(input_ids, attention_mask=attention_masks, pad_token_id=pad_token_ids, images=image_tensor, use_cache=self.use_cache, **gen_kwargs)
Expand Down

0 comments on commit f4eeaa9

Please sign in to comment.