Skip to content

Commit

Permalink
fix def generate_inner_image
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-youngjune committed Dec 23, 2024
1 parent 181db5d commit bd9b975
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion vlmeval/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,3 @@

for grp in model_groups:
supported_VLM.update(grp)

3 changes: 3 additions & 0 deletions vlmeval/vlm/llava/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ def __init__(self, model_path="llava-hf/llava-onevision-qwen2-0.5b-ov-hf", **kwa
self.force_sample = self.video_kwargs.get("force_sample", False)
self.nframe = kwargs.get("nframe", 8)
self.fps = 1
self.model_path = model_path

def generate_inner_image(self, message, dataset=None):
content, images = "", []
Expand Down Expand Up @@ -823,6 +824,8 @@ def generate_inner_image(self, message, dataset=None):
inputs = self.processor(images=images, text=prompt, return_tensors="pt").to(0, torch.float16)

output = self.model.generate(**inputs, max_new_tokens=100)
if self.model_path == "NCSOFT/VARCO-VISION-14B-HF":
return self.processor.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
return self.processor.decode(output[0], skip_special_tokens=True)

def generate_inner_video(self, message, dataset=None):
Expand Down

0 comments on commit bd9b975

Please sign in to comment.