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
45e3d649
"vscode:/vscode.git/clone" did not exist on "7ffe25f2b935dcaf65079b04c5f91c8a42a99e28"
Unverified
Commit
45e3d649
authored
May 17, 2023
by
Zachary Mueller
Committed by
GitHub
May 17, 2023
Browse files
Update error message when Accelerate isn't installed (#23373)
Update error
parent
ea0eb156
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/transformers/training_args.py
src/transformers/training_args.py
+1
-1
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+1
-1
No files found.
src/transformers/training_args.py
View file @
45e3d649
...
...
@@ -1611,7 +1611,7 @@ class TrainingArguments:
logger
.
info
(
"PyTorch: setting up devices"
)
if
not
is_sagemaker_mp_enabled
()
and
not
is_accelerate_available
(
check_partial_state
=
True
):
raise
ImportError
(
"Using the `Trainer` with `PyTorch` requires `accelerate
`: Run `pip install --upgrade
accelerate`"
"Using the `Trainer` with `PyTorch` requires `accelerate
>=0.19.0`: Please run `pip install transformers[torch]` or `pip install
accelerate
-U
`"
)
if
self
.
no_cuda
:
self
.
distributed_state
=
PartialState
(
cpu
=
True
,
backend
=
self
.
ddp_backend
)
...
...
src/transformers/utils/import_utils.py
View file @
45e3d649
...
...
@@ -502,7 +502,7 @@ def is_protobuf_available():
def
is_accelerate_available
(
check_partial_state
=
False
):
if
check_partial_state
:
return
_accelerate_available
and
version
.
parse
(
_accelerate_version
)
>=
version
.
parse
(
"0.1
7
.0"
)
return
_accelerate_available
and
version
.
parse
(
_accelerate_version
)
>=
version
.
parse
(
"0.1
9
.0"
)
return
_accelerate_available
...
...
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