fix: apply paligemma template conditionally

This commit is contained in:
drbh 2024-05-14 15:56:04 -04:00
parent c119ac4d1d
commit d6e306c2b3

View File

@ -173,7 +173,10 @@ class VlmCausalLMBatch(FlashMistralBatch):
image_id = 0 image_id = 0
for chunk in chunks: for chunk in chunks:
if chunk["type"] == "text": if chunk["type"] == "text":
full_text += "<bos>" + chunk["content"] + "\n" if config.model_type == "paligemma":
full_text += "<bos>" + chunk["content"] + "\n"
else:
full_text += chunk["content"]
elif chunk["type"] == "image": elif chunk["type"] == "image":
image = chunk["content"] image = chunk["content"]
# Should never receive URLs anymore, processing should be done # Should never receive URLs anymore, processing should be done