|
4 | 4 | # the file from the modular. If any change should be done, please apply the change to the |
5 | 5 | # modular_videollama3.py file directly. One of our CI enforces this. |
6 | 6 | # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 |
| 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. |
7 | 20 | import math |
8 | 21 | from typing import Optional, Union |
9 | 22 |
|
10 | 23 | import torch |
11 | 24 | import torch.nn.functional as F |
12 | 25 |
|
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 ( |
16 | 34 | IMAGENET_STANDARD_MEAN, |
17 | 35 | IMAGENET_STANDARD_STD, |
18 | 36 | ChannelDimension, |
19 | 37 | ImageInput, |
| 38 | + PILImageResampling, |
20 | 39 | SizeDict, |
21 | 40 | ) |
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 |
28 | 44 |
|
29 | 45 |
|
30 | 46 | logger = logging.get_logger(__name__) |
|
0 commit comments