Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick committed Mar 22, 2024
1 parent 22db9d9 commit 393da76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vlmeval/vlm/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,9 @@ def generate(self, image_path, prompt, dataset=None):
inputs = self.processor(prompt_wtmpl, image, return_tensors='pt').to('cuda')
output = self.model.generate(**inputs, **self.kwargs)
answer = self.processor.decode(output[0], skip_special_token=True)
lt = len(prompt_wtmpl)
if prompt_wtmpl == answer[:lt]:
answer = answer[lt:]
answer = answer.split('</s>')[0]

return answer

0 comments on commit 393da76

Please sign in to comment.