Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…addleNLP into origin_release_3.0-beta2
  • Loading branch information
DesmonDay committed Oct 25, 2024
2 parents bf5551d + 513a966 commit c7c8251
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paddlenlp/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2921,8 +2921,10 @@ def evaluation_loop(
prediction_loss_only = prediction_loss_only if prediction_loss_only is not None else args.prediction_loss_only

if self.args.pipeline_parallel_degree > 1:
from paddle.distributed.fleet.meta_parallel import PipelineLayer

# Only accept wrapped model for pipeline_parallel mode
if self.model is self.model_wrapped:
if self.model is self.model_wrapped and isinstance(self.model_wrapped, PipelineLayer):
# NOTE(gongenlei): when do_train=False, do_eval=True, we need to wrap model for pipeline
self.model_wrapped = fleet.distributed_model(self.model_wrapped)
model = self.model_wrapped
Expand Down

0 comments on commit c7c8251

Please sign in to comment.