transformers
420c80aa - Fall back to flat kwarg when modality dict is passed without it (#46195)

Commit
50 days ago
Fall back to flat kwarg when modality dict is passed without it (#46195) Fall back to flat kwarg when modality dict is passed without it (#46192) When _merge_kwargs sees the modality dict (e.g. text_kwargs={...}) and pops a key from it that isn't there, the flat top-level kwarg with that name was silently dropped. The docstring states flat kwargs have the highest priority, so picking up the flat value in that branch is the intended behavior. Without the fallback, e.g. `processor(text=..., return_tensors='pt', text_kwargs={...})` returned a list of tokens instead of a tensor. Closes #46192
Author
Parents
Loading