Skip to content

Commit c9fd498

Browse files
authored
Fix 'local_rank' AttiributeError in Trainer class (#24297)
fix attribute error
1 parent 850cf4a commit c9fd498

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3250,7 +3250,7 @@ def _nested_gather(self, tensors, name=None):
32503250
elif is_sagemaker_mp_enabled():
32513251
tensors = smp_gather(tensors)
32523252
elif (self.args.distributed_state is not None and self.args.distributed_state.distributed_type != "NO") or (
3253-
self.args.distributed_state is None and self.local_rank != -1
3253+
self.args.distributed_state is None and self.args.local_rank != -1
32543254
):
32553255
tensors = distributed_concat(tensors)
32563256
return tensors

0 commit comments

Comments
 (0)