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

Handling block_size value for models with no sequence length limit. #1487

Merged

Conversation

AdamLouly
Copy link
Contributor

What does this PR do?

Models with no sequence length limit will fail to create a dataset because the block_size will be -1.
and it will error this:
ValueError: num_samples should be a positive integer value, but got num_samples=0

this PR handles the case where max_position_embeddings is -1, we set block size to a default value.

@AdamLouly
Copy link
Contributor Author

@JingyaHuang

Copy link
Contributor

@JingyaHuang JingyaHuang left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks again for patching the example for a wider range of models! @AdamLouly

@JingyaHuang JingyaHuang merged commit e164827 into huggingface:main Oct 27, 2023
48 of 50 checks passed
@AdamLouly
Copy link
Contributor Author

Thanks for the review.

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