Skip to content

Fix: pass return_tensors in text_kwargs for transformers>=5.0.0 compatibility#1648

Open
coding-famer wants to merge 2 commits intoTHUDM:mainfrom
coding-famer:fix/fix_processing_kwargs
Open

Fix: pass return_tensors in text_kwargs for transformers>=5.0.0 compatibility#1648
coding-famer wants to merge 2 commits intoTHUDM:mainfrom
coding-famer:fix/fix_processing_kwargs

Conversation

@coding-famer
Copy link
Contributor

In transformers v5.0.0, return_tensors was moved from
CommonKwargs into each modality's TypedDict (TextKwargs, ImagesKwargs, etc.).
This causes _merge_kwargs to raise a ValueError when return_tensors appears both
as a flat kwarg and inside a modality dict like images_kwargs.

Fix by moving return_tensors=None from a flat kwarg into text_kwargs, so all
return_tensors values are passed through per-modality dicts consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant