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

Use dill pickle to capture the execution context #167

Merged
merged 7 commits into from
Nov 21, 2024
Merged

Conversation

vutrung96
Copy link
Contributor

@vutrung96 vutrung96 commented Nov 21, 2024

This is what HF relies on to capture the closure variables and global variables

We need to use recurse=True to properly capture changing global variables https://github.com/huggingface/datasets/blob/17f17b3fe7f276e1b019cca8aa651bf7c818a928/src/datasets/utils/_dill.py#L101

@vutrung96 vutrung96 changed the base branch from main to dev November 21, 2024 21:02
@vutrung96 vutrung96 changed the title Use dill pickle to capture closure variables and env variables Use dill pickle to capture the execution context Nov 21, 2024
@vutrung96 vutrung96 requested a review from CharlieJCJ November 21, 2024 22:37
Copy link
Contributor

@CharlieJCJ CharlieJCJ left a comment

Choose a reason for hiding this comment

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

LGTM, suggested nested function tests since this PR also address #127 , thanks @vutrung96 !

Action Item: use mock objects in unit tests

@vutrung96 vutrung96 merged commit 14bd655 into dev Nov 21, 2024
2 checks passed
@vutrung96 vutrung96 deleted the trung/code-object branch November 21, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants