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

Add delta to mds converter #363

Merged
merged 116 commits into from
Sep 8, 2023
Merged

Conversation

XiaohanZhangCMU
Copy link
Member

@XiaohanZhangCMU XiaohanZhangCMU commented Aug 4, 2023

Description of changes:

  • Introduced a utility function for converting a Spark DataFrame into an MDS format.
  • This utility function is flexible and supports a callable function, allowing modifications to the original data format. The function iterates over the callable, processes the modified data, and writes it in MDS format. For instance, it can be used with a tokenizer callable function that yields tokens as output.
  • Included an example Jupyter notebook demonstrating a complete workflow. It illustrates how to transform raw data into a Spark DataFrame and then convert it into the MDS format.

Issue #, if available

STR-111

Merge Checklist:

Put an x without space in the boxes that apply. If you are unsure about any checklist, please don't hesitate to ask. We are here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the contributor guidelines
  • This is a documentation change or typo fix. If so, skip the rest of this checklist.
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the MosaicML team.
  • I have updated any necessary documentation, including README and API docs (if appropriate).

Tests

  • I ran pre-commit on my change. (check out the pre-commit section of prerequisites)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate).
  • I ran the tests locally to make sure it pass. (check out testing)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes.

Copy link
Collaborator

@karan6181 karan6181 left a comment

Choose a reason for hiding this comment

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

Please clean all the output of jupyter notebook before you add it here.

docs/source/index.md Outdated Show resolved Hide resolved
streaming/base/converters/dataframe_to_mds.py Outdated Show resolved Hide resolved
streaming/base/converters/dataframe_to_mds.py Outdated Show resolved Hide resolved
tests/base/converters/test_dataframe_to_mds.py Outdated Show resolved Hide resolved
tests/base/converters/test_dataframe_to_mds.py Outdated Show resolved Hide resolved
tests/base/converters/test_dataframe_to_mds.py Outdated Show resolved Hide resolved
tests/base/converters/test_dataframe_to_mds.py Outdated Show resolved Hide resolved
tests/base/converters/test_dataframe_to_mds.py Outdated Show resolved Hide resolved
tests/base/converters/test_dataframe_to_mds.py Outdated Show resolved Hide resolved
@karan6181 karan6181 merged commit 703afa6 into mosaicml:main Sep 8, 2023
6 checks passed
mds_writer.write(sample)
except:
raise RuntimeError(f'failed to write sample: {sample}')
count += 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized that while my conversation was marked resolved, nothing actually changed here. The count +=1 is unreachable here now so the error counting is kinda useless.

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.

7 participants