pinning transformers version

This commit is contained in:
Salman Mohammadi
2025-04-08 17:17:23 +01:00
parent b98dbafc31
commit e1a8dfbe8c
7 changed files with 111 additions and 208 deletions

View File

@@ -33,6 +33,18 @@ def with_temp_dir(test_func):
return wrapper
def require_torch_2_7_0(test_case):
"""
Decorator marking a test that requires torch >= 2.7.0
"""
def is_min_2_7_0():
torch_version = version.parse(torch.__version__)
return torch_version >= version.parse("2.7.0")
return unittest.skipUnless(is_min_2_7_0(), "test requires torch>=2.7.0")(test_case)
def most_recent_subdir(path):
base_path = Path(path)
subdirectories = [d for d in base_path.iterdir() if d.is_dir()]