Skip to content

Remove block size limitation #52

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

Draft
wants to merge 1 commit into
base: llama2-google-next-training
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions examples/pytorch/language-modeling/run_clm.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,12 +681,13 @@ def tokenize_function(examples):
)
block_size = min(1024, config.max_position_embeddings)
else:
if data_args.block_size > tokenizer.model_max_length:
logger.warning(
f"The block_size passed ({data_args.block_size}) is larger than the maximum length for the model "
f"({tokenizer.model_max_length}). Using block_size={tokenizer.model_max_length}."
)
block_size = min(data_args.block_size, tokenizer.model_max_length)
#if data_args.block_size > tokenizer.model_max_length:
# logger.warning(
# f"The block_size passed ({data_args.block_size}) is larger than the maximum length for the model "
# f"({tokenizer.model_max_length}). Using block_size={tokenizer.model_max_length}."
# )
#block_size = min(data_args.block_size, tokenizer.model_max_length)
block_size = data_args.block_size

# Main data processing function that will concatenate all texts from our dataset and generate chunks of block_size.
def group_texts(examples):
Expand Down