Skip to content

Commit 94bd65e

Browse files
committed
Fix
1 parent 9c79c24 commit 94bd65e

11 files changed

Lines changed: 827 additions & 291 deletions

src/transformers/modeling_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ def is_local_dist_rank_0():
220220
"qwen2vl",
221221
"qwen2_5_vl",
222222
"videollava",
223-
"videollama3",
224223
"vipllava",
225224
]
226225

src/transformers/models/videollama3/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2025 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
from typing import TYPE_CHECKING
215

316
from ...utils import _LazyModule

src/transformers/models/videollama3/configuration_videollama3.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@
44
# the file from the modular. If any change should be done, please apply the change to the
55
# modular_videollama3.py file directly. One of our CI enforces this.
66
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
7-
from transformers.configuration_utils import PretrainedConfig
8-
7+
# Copyright 2025 The HuggingFace Team. All rights reserved.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
from ...configuration_utils import PretrainedConfig
921
from ..auto import CONFIG_MAPPING, AutoConfig
1022

1123

src/transformers/models/videollama3/image_processing_videollama3.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
1+
# Copyright 2025 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
"""Image processor class for VideoLLaMA3."""
215

316
import math
417
from typing import Optional, Union
518

619
import numpy as np
720

8-
from transformers.feature_extraction_utils import BatchFeature
9-
from transformers.image_utils import (
21+
from ...feature_extraction_utils import BatchFeature
22+
from ...image_processing_utils import BaseImageProcessor
23+
from ...image_transforms import convert_to_rgb, resize, to_channel_dimension_format
24+
from ...image_utils import (
1025
IMAGENET_STANDARD_MEAN,
1126
IMAGENET_STANDARD_STD,
1227
ChannelDimension,
1328
ImageInput,
1429
PILImageResampling,
1530
get_image_size,
31+
infer_channel_dimension_format,
32+
is_scaled_image,
1633
make_flat_list_of_images,
34+
make_list_of_images,
35+
to_numpy_array,
1736
valid_images,
1837
validate_preprocess_arguments,
1938
)
20-
from transformers.utils import TensorType, logging
21-
from transformers.video_utils import VideoInput
22-
23-
from ...image_processing_utils import BaseImageProcessor
24-
from ...image_transforms import convert_to_rgb, resize, to_channel_dimension_format
25-
from ...image_utils import infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array
39+
from ...utils import TensorType, logging
40+
from ...video_utils import VideoInput
2641

2742

2843
logger = logging.get_logger(__name__)

src/transformers/models/videollama3/image_processing_videollama3_fast.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,43 @@
44
# the file from the modular. If any change should be done, please apply the change to the
55
# modular_videollama3.py file directly. One of our CI enforces this.
66
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
7+
# Copyright 2025 The HuggingFace Team. All rights reserved.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
720
import math
821
from typing import Optional, Union
922

1023
import torch
1124
import torch.nn.functional as F
1225

13-
from transformers.feature_extraction_utils import BatchFeature
14-
from transformers.image_processing_utils_fast import DefaultFastImageProcessorKwargs
15-
from transformers.image_utils import (
26+
from ...feature_extraction_utils import BatchFeature
27+
from ...image_processing_utils_fast import (
28+
BaseImageProcessorFast,
29+
DefaultFastImageProcessorKwargs,
30+
group_images_by_shape,
31+
reorder_images,
32+
)
33+
from ...image_utils import (
1634
IMAGENET_STANDARD_MEAN,
1735
IMAGENET_STANDARD_STD,
1836
ChannelDimension,
1937
ImageInput,
38+
PILImageResampling,
2039
SizeDict,
2140
)
22-
from transformers.processing_utils import Unpack
23-
from transformers.utils import TensorType, auto_docstring, logging
24-
from transformers.video_utils import VideoInput, make_batched_videos
25-
26-
from ...image_processing_utils_fast import BaseImageProcessorFast, group_images_by_shape, reorder_images
27-
from ...image_utils import PILImageResampling
41+
from ...processing_utils import Unpack
42+
from ...utils import TensorType, auto_docstring, logging
43+
from ...video_utils import VideoInput, make_batched_videos
2844

2945

3046
logger = logging.get_logger(__name__)

0 commit comments

Comments
 (0)