liuyizhang commited on
Commit
b67365a
1 Parent(s): 21dafa0

update dependency_versions_check.py

Browse files
transformers_4_35_0/dependency_versions_check.py CHANGED
@@ -37,27 +37,29 @@ pkgs_to_check_at_runtime = [
37
  "pyyaml",
38
  ]
39
 
40
- for pkg in pkgs_to_check_at_runtime:
41
- if pkg in deps:
42
- if pkg == "tokenizers":
43
- # must be loaded here, or else tqdm check may fail
44
- from .utils import is_tokenizers_available
45
-
46
- if not is_tokenizers_available():
47
- continue # not required, check version only if installed
48
- elif pkg == "accelerate":
49
- # must be loaded here, or else tqdm check may fail
50
- from .utils import is_accelerate_available
51
-
52
- # Maybe switch to is_torch_available in the future here so that Accelerate is hard dep of
53
- # Transformers with PyTorch
54
- if not is_accelerate_available():
55
- continue # not required, check version only if installed
56
-
57
- require_version_core(deps[pkg])
58
- else:
59
- raise ValueError(f"can't find {pkg} in {deps.keys()}, check dependency_versions_table.py")
60
-
61
-
62
- def dep_version_check(pkg, hint=None):
63
- require_version(deps[pkg], hint)
 
 
 
37
  "pyyaml",
38
  ]
39
 
40
+ # yizhangliu
41
+ if 0==1:
42
+ for pkg in pkgs_to_check_at_runtime:
43
+ if pkg in deps:
44
+ if pkg == "tokenizers":
45
+ # must be loaded here, or else tqdm check may fail
46
+ from .utils import is_tokenizers_available
47
+
48
+ if not is_tokenizers_available():
49
+ continue # not required, check version only if installed
50
+ elif pkg == "accelerate":
51
+ # must be loaded here, or else tqdm check may fail
52
+ from .utils import is_accelerate_available
53
+
54
+ # Maybe switch to is_torch_available in the future here so that Accelerate is hard dep of
55
+ # Transformers with PyTorch
56
+ if not is_accelerate_available():
57
+ continue # not required, check version only if installed
58
+
59
+ require_version_core(deps[pkg])
60
+ else:
61
+ raise ValueError(f"can't find {pkg} in {deps.keys()}, check dependency_versions_table.py")
62
+
63
+
64
+ def dep_version_check(pkg, hint=None):
65
+ require_version(deps[pkg], hint)