Spaces:
Runtime error
Runtime error
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 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
|
|
|
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)
|