Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Pretrain] Fix eval during pretrain #7827

Merged
merged 5 commits into from
Jan 11, 2024

Conversation

DesmonDay
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

Change paddle.to_tensor to copy.deepcopy.

Copy link

paddle-bot bot commented Jan 11, 2024

Thanks for your contribution!

@DesmonDay DesmonDay requested a review from ZHUI January 11, 2024 04:50
JunnYu
JunnYu previously approved these changes Jan 11, 2024
@@ -261,7 +262,7 @@ def print_dataset(data, mode="train"):
def _collate_data(data, stack_fn=Stack()):
tokens_ = stack_fn([x["text"] for x in data])

labels = tokens_[:, 1:]
labels = copy.deepcopy(tokens_)[:, 1:]
Copy link
Collaborator

Choose a reason for hiding this comment

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

之前 to_tensor 的修改要回退吗?

return {
"input_ids": paddle.to_tensor(tokens),
"labels": paddle.to_tensor(labels),
}

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 Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4069f22) 56.95% compared to head (2c6b9c8) 56.95%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7827   +/-   ##
========================================
  Coverage    56.95%   56.95%           
========================================
  Files          587      587           
  Lines        88628    88628           
========================================
  Hits         50480    50480           
  Misses       38148    38148           

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

@wawltor wawltor merged commit ee4b9dd into PaddlePaddle:develop Jan 11, 2024
8 of 9 checks passed
JunnYu pushed a commit that referenced this pull request Jan 12, 2024
* add unified checkpoint training args doc

* fix eval during pretrain

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants