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 safe_load option to restrict HF dataset downloads to allowed file types #798

Merged
merged 23 commits into from
Jan 5, 2024

Conversation

irenedea
Copy link
Contributor

@irenedea irenedea commented Dec 12, 2023

Manual Tests

test-safe-load-false-valid-hvr7NF - safe_load=False + valid dataset (runs successfully)
test-safe-load-LZNNUv - safe_load=True + valid dataset (runs successfully)
test-safe-load-squad-Lku1Q4 - safe_load=True + invalid dataset (fails with proper error)
test-no-safe-load-squad-jhdtOQ - safe_load=False + invalid dataset (loads the dataset, fails bc data formatting reasons)

safe_load does not add any noticeable overhead. Both runs (valid dataset with safe_load=True and with safe_load=False) take 7 min.

Copy link
Collaborator

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

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

generally lgtm. Could you provide some manual testing? Please test both using a custom file, and using both supported and unsupported datasets from the hub.

In the custom file and support hub dataset cases, check that it runs and also that startup time is not dramatically slower than previously.

For the unsupported hub dataset case, just make sure it errors in a reasonable way (i.e. doesn't hang or something)

llmfoundry/data/finetuning/dataloader.py Outdated Show resolved Hide resolved
llmfoundry/data/finetuning/dataloader.py Outdated Show resolved Hide resolved
llmfoundry/data/finetuning/dataloader.py Show resolved Hide resolved
llmfoundry/data/finetuning/dataloader.py Show resolved Hide resolved
llmfoundry/data/finetuning/tasks.py Outdated Show resolved Hide resolved
tests/data/test_dataloader.py Show resolved Hide resolved
@irenedea irenedea requested a review from a team as a code owner December 19, 2023 03:07
tests/data/test_dataloader.py Outdated Show resolved Hide resolved
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
@irenedea irenedea enabled auto-merge (squash) January 5, 2024 00:39
@irenedea irenedea merged commit f0fd749 into mosaicml:main Jan 5, 2024
10 checks passed
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.

2 participants