mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 11:41:51 +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():
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user