From c9fd49853ff16dbf562de9d1c8afffe24fbd7fa1 Mon Sep 17 00:00:00 2001 From: Tomoko Uchida Date: Tue, 27 Jun 2023 02:38:29 +0900 Subject: [PATCH] Fix 'local_rank' AttiributeError in Trainer class (#24297) fix attribute error --- src/transformers/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index 2ff4f93fdfc..6beb0a6b68f 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -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