Skip to content

Commit

Permalink
Update llava.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick committed Dec 27, 2023
1 parent b0b1c64 commit 9f96756
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlmeval/vlm/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def build_prompt(self, line, dataset=None):
question = line['question']
hint = line['hint'] if ('hint' in line and not pd.isna(line['hint'])) else None
if hint is not None:
question + hint + '\n' + question
question = hint + '\n' + question

options = {
cand: line[cand]
Expand Down Expand Up @@ -107,4 +107,4 @@ def generate(self, image_path, prompt, dataset=None):
with torch.inference_mode():
output_ids = self.model.generate(input_ids, images=image_tensor, stopping_criteria=[stopping_criteria], **self.kwargs)
output = self.tokenizer.decode(output_ids[0, input_ids.shape[1]: ]).strip().split("</s>")[0]
return output
return output

0 comments on commit 9f96756

Please sign in to comment.