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 examples for HF datasets #1371

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Add examples for HF datasets #1371

wants to merge 7 commits into from

Conversation

ramanishsingh
Copy link
Contributor

Adding examples for HF datasets with nodes.

Fixes #1352

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 22, 2024
Copy link

pytorch-bot bot commented Nov 22, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/data/1371

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit d906a44 with merge base aebad0c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@@ -0,0 +1,82 @@
from datasets import Dataset # make sure that you have huggingface datasets installed

data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Along with an simple example like this, I wonder if it would add value to include an actual HF Dataset - maybe a text one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's my goal as well.
I am facing some fwdproxy issues with loading the datasets from huggingface.
I am trying to resolve that, after that I can include examples with more complex datasets.


source_node = IterableWrapper(ds)

print("==" * 20)
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing I had in mind with /examples, we don't expect users to really run the code, but mostly use it as a reference implementation to port over their workflows. I wonder if we can write this file such that users can see all the relevant nodes linked together clearly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sure.
I will port these examples to a Jupyter notebook with print outputs in the file so it is easier to get the outputs.
Will also add some interleaved examples where we use multiple node functionalities together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WIP] Examples for demonstrating the usage and incremental value of TorchData Nodes
3 participants