mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-30 17:52:35 +06:00
Fix 'local_rank' AttiributeError in Trainer class (#24297)
fix attribute error
This commit is contained in:
parent
850cf4af0c
commit
c9fd49853f
@ -3250,7 +3250,7 @@ class Trainer:
|
||||
elif is_sagemaker_mp_enabled():
|
||||
tensors = smp_gather(tensors)
|
||||
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)
|
||||
return tensors
|
||||
|
Loading…
Reference in New Issue
Block a user