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

The input training data files (multiple files in glob format). #7717

Merged
merged 1 commit into from Oct 12, 2020
Merged

The input training data files (multiple files in glob format). #7717

merged 1 commit into from Oct 12, 2020

Conversation

kfkelvinng
Copy link
Contributor

@kfkelvinng kfkelvinng commented Oct 11, 2020

Very often Corpus comes in split files (book-large-p1.txt, book-large-p2.txt); Also splitting large files to smaller files can prevent language_modeling's tokenizer going out of memory in environment like Colab that does not have swap memory and limited to Standard (12Gb) or High RAM (25Gb) instances.

To avoid making any assumption and prematurely truncate the file to avoid such error, we add support to concatenate training data on Dataset level. User can split files to multiple 512Mb, in that case language_modeling's tokenizer would be less to go out of memory.

In addition, it would even further enhance the memory limitation if we keep pytorch tensor in memory instead of python list. We leave this in future work.

@LysandreJik @sgugger

Very often splitting large files to smaller files can prevent tokenizer going out of memory in environment like Colab that does not have swap memory
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

This looks good to me. What do you think @sgugger ?

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the addition!

@sgugger sgugger merged commit f176e70 into huggingface:master Oct 12, 2020
@kfkelvinng kfkelvinng deleted the large_corpus_split_concat branch October 12, 2020 21:26
fabiocapsouza pushed a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
…ngface#7717)

Very often splitting large files to smaller files can prevent tokenizer going out of memory in environment like Colab that does not have swap memory
fabiocapsouza added a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
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.

None yet

3 participants