Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick committed Sep 25, 2024
1 parent 5d56b72 commit 04d90d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlmeval/vlm/moondream.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def generate_inner(self, message, dataset=None):
images = [Image.open(s) for s in images]
enc_image = self.model.encode_image(images[0])

prompt_wtmpl = prompt = f'<image>\n\nQuestion: {question}\n\nAnswer: '
prompt_wtmpl = prompt = f'<image>\n\nQuestion: {prompt}\n\nAnswer: '
answer = self.model.generate(enc_image, prompt_wtmpl, eos_text='<END>', tokenizer=tokenizer, **self.kwargs)[0]
cleaned_answer = re.sub('<$', '', re.sub('END$', '', answer)).strip()
return cleaned_answer
Expand Down

0 comments on commit 04d90d4

Please sign in to comment.