mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 02:31:11 +06:00
Patch CLIP image preprocessor (#30698)
* patch clip preprocessor * Update image_processing_clip.py * Update src/transformers/models/clip/image_processing_clip.py Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> --------- Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
This commit is contained in:
parent
5b7a225f25
commit
508c0bfe55
@ -141,7 +141,7 @@ class CLIPImageProcessor(BaseImageProcessor):
|
||||
]
|
||||
|
||||
# for backwards compatibility of KOSMOS-2
|
||||
if "use_square_size" in kwargs:
|
||||
if "use_square_size" in kwargs and kwargs["use_square_size"]:
|
||||
self.size = {"height": size["shortest_edge"], "width": size["shortest_edge"]}
|
||||
# Let's remove `use_square_size` (as it is removed from #27690), so the future Kosmos-2 image processors
|
||||
# won't have this attr. being saved. (otherwise, it will enter this if branch while there is no more
|
||||
|
Loading…
Reference in New Issue
Block a user