mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-03 04:02:49 +08:00
[data] add forward compatibility for video_utils in Transformers 4.52.0 (#8077)
This commit is contained in:
parent
130bfaf8e3
commit
66f719dd96
@ -58,7 +58,18 @@ if is_transformers_version_greater_than("4.45.0"):
|
|||||||
|
|
||||||
|
|
||||||
if is_transformers_version_greater_than("4.49.0"):
|
if is_transformers_version_greater_than("4.49.0"):
|
||||||
from transformers.image_utils import make_batched_videos, make_flat_list_of_images
|
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.video_utils import make_batched_videos
|
||||||
|
from transformers.image_utils import make_flat_list_of_images
|
||||||
|
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 TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user