[deps] update to transformers 4.52 (#8125)

This commit is contained in:
hoshi-hiyouga
2025-05-21 05:16:18 +08:00
committed by GitHub
parent 56926d76f9
commit 9ae17cd173
28 changed files with 365 additions and 109 deletions

View File

@@ -57,19 +57,11 @@ if is_transformers_version_greater_than("4.45.0"):
)
if is_transformers_version_greater_than("4.49.0"):
try:
from transformers.image_utils import make_batched_videos, make_flat_list_of_images
except ImportError:
try:
# If that fails, try importing from the new location
from transformers.image_utils import make_flat_list_of_images
from transformers.video_utils import make_batched_videos
except ImportError:
raise ImportError(
"Could not import make_batched_videos and make_flat_list_of_images. "
"In Transformers 4.52.0, make_batched_videos will be moved to transformers.video_utils."
)
if is_transformers_version_greater_than("4.52.0"):
from transformers.image_utils import make_flat_list_of_images
from transformers.video_utils import make_batched_videos
elif is_transformers_version_greater_than("4.49.0"):
from transformers.image_utils import make_batched_videos, make_flat_list_of_images
if TYPE_CHECKING: