Skip to content

Commit a3777b6

Browse files
committed
Fix type hints in ViltImageProcessorFast for Python compatibility
1 parent b0402fa commit a3777b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/transformers/models/vilt/image_processing_vilt_fast.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
"""Fast Image processor class for Vilt."""
1616

17-
from typing import Optional
17+
from typing import List, Optional, Union
1818

1919
from ...image_processing_utils import BatchFeature
2020
from ...image_processing_utils_fast import (
@@ -88,9 +88,9 @@ def _preprocess(
8888
do_rescale: bool,
8989
rescale_factor: float,
9090
do_normalize: bool,
91-
image_mean: Optional[float | list[float]],
92-
image_std: Optional[float | list[float]],
93-
return_tensors: Optional[str | TensorType],
91+
image_mean: Optional[Union[float, List[float]]],
92+
image_std: Optional[Union[float, List[float]]],
93+
return_tensors: Optional[Union[str, TensorType]],
9494
**kwargs,
9595
) -> BatchFeature:
9696
"""

0 commit comments

Comments
 (0)