Skip to content

Commit

Permalink
Remove handling non-visual loop in llava
Browse files Browse the repository at this point in the history
  • Loading branch information
kcz358 committed Jun 20, 2024
1 parent efb5295 commit 3463651
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lmms_eval/models/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,6 @@ def _collate(x):
prompt_question = conv.get_prompt()
question_input.append(prompt_question)

# The above for loop has bugs. When there is no visuals, e.g. pure text,
# there will be no for loop execute resulting in an empty question_input (because no visuals)
# Scenario 1 won't even be execute
if len(flattened_visuals) == 0:
for context in contexts:
question = context
conv = conv_templates[self.conv_template].copy()
conv.append_message(conv.roles[0], question)
conv.append_message(conv.roles[1], None)
prompt_question = conv.get_prompt()
question_input.append(prompt_question)

# input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt").unsqueeze(0).to(self.device)
# preconfigure gen_kwargs with defaults
Expand Down

0 comments on commit 3463651

Please sign in to comment.