Skip to content

Commit 68e76d5

Browse files
committed
Unify is_torchvision_v2_available with is_torchvision_available
Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
1 parent 1f1e93e commit 68e76d5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/transformers/utils/import_utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,7 @@ def is_torchvision_available() -> bool:
400400

401401

402402
def is_torchvision_v2_available() -> bool:
403-
if not is_torchvision_available():
404-
return False
405-
406-
# NOTE: We require torchvision>=0.15 as v2 transforms are available from this version: https://pytorch.org/vision/stable/transforms.html#v1-or-v2-which-one-should-i-use
407-
return version.parse(_torchvision_version) >= version.parse("0.15")
403+
return is_torchvision_available()
408404

409405

410406
def is_galore_torch_available() -> Union[tuple[bool, str], bool]:

0 commit comments

Comments
 (0)