-
Notifications
You must be signed in to change notification settings - Fork 3k
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
support sft mapdataset #8840
support sft mapdataset #8840
Conversation
Thanks for your contribution! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8840 +/- ##
===========================================
- Coverage 55.44% 55.35% -0.10%
===========================================
Files 631 631
Lines 98542 98782 +240
===========================================
+ Hits 54632 54676 +44
- Misses 43910 44106 +196 ☔ View full report in Codecov by Sentry. |
paddlenlp/data/indexed_dataset.py
Outdated
@@ -68,6 +69,20 @@ def make_dataset(path, impl, skip_warmup=False): | |||
return None | |||
|
|||
|
|||
def make_sft_dataset(path, impl, dataclass, skip_warmup=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要么就只支持mmap的吧,不用判断了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经修改,不是mmap直接报错
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议:make_sft_dataset(path, dataclass, skip_warmup=False, impl=“mmap”)
paddlenlp/data/indexed_dataset.py
Outdated
@@ -548,13 +574,259 @@ def exists(path): | |||
return os.path.exists(index_file_path(path)) and os.path.exists(data_file_path(path)) | |||
|
|||
|
|||
class SFT_MMapIndexedDataset(paddle.io.Dataset): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里class采用驼峰命名,不要下划线。
paddlenlp/data/indexed_dataset.py
Outdated
def make_builder(out_file, impl, save_dtype, loss_mask_file=None): | ||
if impl == "mmap": | ||
return MMapIndexedDatasetBuilder(out_file, dtype=save_dtype, loss_mask_file=loss_mask_file) | ||
else: | ||
return IndexedDatasetBuilder(out_file, dtype=save_dtype) | ||
|
||
|
||
class SFT_MMapIndexedDatasetBuilder(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个命名同样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New Features
PR changes
Add SFTMMapIndexedDataset and SFTMMapIndexedDatasetBuilder
Description
Support offline SFT dataset.