-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: LlavaProcessor: got multiple values for keyword argument 'images' #36578
Comments
After investigation, I think the issue arises after the merge of: After this PR, the processor is explicitly called with out = self(
text=prompt,
images=images if images else None,
videos=videos if videos else None,
**kwargs,
)
|
Hey @albertvillanova ! Yes, in apply chat template we prev did not accept images. Even though it was possible to pass images, they weren't being processed. From the new version if we want to get processed images+text+videos with formatted text, we need to pass images as part of the conversation dict See https://huggingface.co/docs/transformers/main/en/chat_templating_multimodal#image-inputs EDIT; and yeah, we expect the models to be in standard API for processor kwargs. Since we already have all models withtin transformers working correctly, that was not breaking. Not sure how smolagent processor looks like |
See my comment above: #36578 (comment)
EDIT: |
@albertvillanova i see, but |
Thanks for the explanation, @zucchini-nlp. CC: @merveenoyan who implemented it in images = [Image.open(image) for image in images] if images else None
prompt_tensor = self.processor.apply_chat_template(
messages,
tools=[get_tool_json_schema(tool) for tool in tools_to_call_from] if tools_to_call_from else None,
return_tensors="pt",
tokenize=True,
return_dict=True,
images=images,
add_generation_prompt=True if tools_to_call_from else False, I guess we should fix this in |
System Info
transformers
version: 4.49.0Who can help?
After the release of transformers-4.49.0, we get an error in a smolagents CI test:
We fixed the issue by pinning transformers<4.49.0:
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
The failing test code is: https://github.com/huggingface/smolagents/blob/40d795ddb60808d5094efad8e909f39376896d17/tests/test_models.py#L95-L107
The relevant code in smolagents, where we pass
images
kwarg toprocessor.apply_chat_template
, is:The stack trace: https://github.com/huggingface/smolagents/actions/runs/13391491485/job/37400017221
Expected behavior
No error.
The text was updated successfully, but these errors were encountered: