Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
8978b696
Unverified
Commit
8978b696
authored
Jun 14, 2023
by
Sylvain Gugger
Committed by
GitHub
Jun 14, 2023
Browse files
Update check of core deps (#24277)
parent
c4fec38b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
src/transformers/dependency_versions_check.py
src/transformers/dependency_versions_check.py
+23
-3
No files found.
src/transformers/dependency_versions_check.py
View file @
8978b696
...
...
@@ -23,9 +23,21 @@ from .utils.versions import require_version, require_version_core
# order specific notes:
# - tqdm must be checked before tokenizers
pkgs_to_check_at_runtime
=
"python tqdm regex requests packaging filelock numpy tokenizers"
.
split
()
if
sys
.
version_info
<
(
3
,
7
):
pkgs_to_check_at_runtime
.
append
(
"dataclasses"
)
pkgs_to_check_at_runtime
=
[
"python"
,
"tqdm"
,
"regex"
,
"requests"
,
"packaging"
,
"filelock"
,
"numpy"
,
"tokenizers"
,
"huggingface-hub"
,
"safetensors"
,
"accelerate"
,
"pyyaml"
,
]
if
sys
.
version_info
<
(
3
,
8
):
pkgs_to_check_at_runtime
.
append
(
"importlib_metadata"
)
...
...
@@ -37,6 +49,14 @@ for pkg in pkgs_to_check_at_runtime:
if
not
is_tokenizers_available
():
continue
# not required, check version only if installed
elif
pkg
==
"accelerate"
:
# must be loaded here, or else tqdm check may fail
from
.utils
import
is_accelerate_available
# Maybe switch to is_torch_available in the future here so that Accelerate is hard dep of
# Transformers with PyTorch
if
not
is_accelerate_available
():
continue
# not required, check version only if installed
require_version_core
(
deps
[
pkg
])
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment