Skip to content

Commit 62fa18e

Browse files
committed
Update torch minimum version check to 2.2
Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
1 parent 6e50a8a commit 62fa18e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/transformers/utils/import_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[
248248
if USE_TORCH in ENV_VARS_TRUE_AND_AUTO_VALUES and USE_TF not in ENV_VARS_TRUE_VALUES:
249249
_torch_available, _torch_version = _is_package_available("torch", return_version=True)
250250
if _torch_available:
251-
_torch_available = version.parse(_torch_version) >= version.parse("2.1.0")
251+
_torch_available = version.parse(_torch_version) >= version.parse("2.2.0")
252252
if not _torch_available:
253-
logger.warning(f"Disabling PyTorch because PyTorch >= 2.1 is required but found {_torch_version}")
253+
logger.warning(f"Disabling PyTorch because PyTorch >= 2.2 is required but found {_torch_version}")
254254
else:
255255
logger.info("Disabling PyTorch because USE_TF is set")
256256
_torch_available = False

tests/models/qwen2_5_vl/test_modeling_qwen2_5_vl.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
if is_torch_available():
5656
import torch
5757

58-
else:
59-
is_torch_greater_or_equal_than_2_0 = False
6058

6159
if is_vision_available():
6260
from PIL import Image

0 commit comments

Comments
 (0)