From b21215554e8051b6e1bdf6811c7f938218eb1c7b Mon Sep 17 00:00:00 2001 From: Daniel Ohayon Date: Thu, 28 Nov 2024 10:52:53 +0200 Subject: [PATCH] Update llama_vision.py BugFix: llama_vision processor accepts "text" key and not "content" key. --- lmms_eval/models/llama_vision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmms_eval/models/llama_vision.py b/lmms_eval/models/llama_vision.py index 52e63aad..2051dd2c 100644 --- a/lmms_eval/models/llama_vision.py +++ b/lmms_eval/models/llama_vision.py @@ -201,7 +201,7 @@ def generate_until(self, requests: List[Instance]) -> List[str]: for _ in range(len(images)): messages[-1]["content"].append({"type": "image"}) - messages[-1]["content"].append({"type": "text", "content": contexts}) + messages[-1]["content"].append({"type": "text", "text": contexts}) prompt = self.processor.apply_chat_template(messages, add_generation_prompt=True) inputs = self.processor(images, prompt, return_tensors="pt").to(self.model.device)