Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Trainer] fix save_model #9286

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Conversation

DesmonDay
Copy link
Contributor

PR types

Others

PR changes

Others

Description

Modify the save_model call to enhance compatibility.

Copy link

paddle-bot bot commented Oct 17, 2024

Thanks for your contribution!

if isinstance(self.model, LoRAModel) and (self.model.quantized or self.args.pipeline_parallel_degree > 1):
self.save_model(output_dir, False, signal_dir)
elif isinstance(self.model, LoRAModel) or isinstance(self.model, PrefixModelForCausalLM):
self.save_model(output_dir, True, signal_dir)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signal_dir = os.path.join(signal_dir, os.path.split(output_dir)[-1])

ZHUI
ZHUI previously approved these changes Oct 17, 2024
ZHUI
ZHUI previously approved these changes Oct 17, 2024
Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 53.09%. Comparing base (5244e61) to head (2eafad3).
Report is 266 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/trainer/trainer.py 55.55% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9286      +/-   ##
===========================================
- Coverage    53.27%   53.09%   -0.19%     
===========================================
  Files          657      657              
  Lines       107194   106533     -661     
===========================================
- Hits         57104    56559     -545     
+ Misses       50090    49974     -116     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@wawltor wawltor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wawltor wawltor merged commit 2b975b1 into PaddlePaddle:develop Oct 17, 2024
8 of 12 checks passed
DesmonDay added a commit to DesmonDay/PaddleNLP that referenced this pull request Oct 17, 2024
DesmonDay added a commit to DesmonDay/PaddleNLP that referenced this pull request Oct 17, 2024
wawltor pushed a commit that referenced this pull request Oct 17, 2024
* [Unified Checkpoint] update async save logic (#9274)

* update async save signal

* fix async save hang

* bug fix

* [Trainer] fix save_model (#9286)

* bug fix

* bug fix
wawltor pushed a commit that referenced this pull request Oct 17, 2024
* [Unified Checkpoint] Support expert parallel (#9055)

* update code

* [Unified Checkpoint] Fix generation config save (#9223)

* [Unified Checkpoint] update async_save_info in develop (#9173)

* [Unified Checkpoint] update async save logic (#9274)

* update async save signal

* fix async save hang

* bug fix

* bug fix

* [Trainer] fix save_model (#9286)

* bug fix

* bug fix

---------

Co-authored-by: Weiguo Zhu <DrownFish19@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants