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
c9fd4985
Unverified
Commit
c9fd4985
authored
Jun 27, 2023
by
Tomoko Uchida
Committed by
GitHub
Jun 26, 2023
Browse files
Fix 'local_rank' AttiributeError in Trainer class (#24297)
fix attribute error
parent
850cf4af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/trainer.py
src/transformers/trainer.py
+1
-1
No files found.
src/transformers/trainer.py
View file @
c9fd4985
...
@@ -3250,7 +3250,7 @@ class Trainer:
...
@@ -3250,7 +3250,7 @@ class Trainer:
elif
is_sagemaker_mp_enabled
():
elif
is_sagemaker_mp_enabled
():
tensors
=
smp_gather
(
tensors
)
tensors
=
smp_gather
(
tensors
)
elif
(
self
.
args
.
distributed_state
is
not
None
and
self
.
args
.
distributed_state
.
distributed_type
!=
"NO"
)
or
(
elif
(
self
.
args
.
distributed_state
is
not
None
and
self
.
args
.
distributed_state
.
distributed_type
!=
"NO"
)
or
(
self
.
args
.
distributed_state
is
None
and
self
.
local_rank
!=
-
1
self
.
args
.
distributed_state
is
None
and
self
.
args
.
local_rank
!=
-
1
):
):
tensors
=
distributed_concat
(
tensors
)
tensors
=
distributed_concat
(
tensors
)
return
tensors
return
tensors
...
...
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