Skip to content

Commit

Permalink
refactor: change default block_size in block size > max position embe…
Browse files Browse the repository at this point in the history
…ddings (huggingface#26069)

* refactor: change default block_size when not initialize

* reformat: add the min of block size
  • Loading branch information
pphuc25 authored and parambharat committed Sep 26, 2023
1 parent b73340c commit fcd14ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/flax/language-modeling/run_clm_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,9 @@ def tokenize_function(examples):
if block_size > config.max_position_embeddings:
logger.warning(
f"The tokenizer picked seems to have a very large `model_max_length` ({tokenizer.model_max_length}). "
"Picking 1024 instead. You can change that default value by passing --block_size xxx."
f"Using block_size={min(1024, config.max_position_embeddings)} instead. You can change that default value by passing --block_size xxx."
)
block_size = 1024
block_size = min(1024, config.max_position_embeddings)
else:
if data_args.block_size > tokenizer.model_max_length:
logger.warning(
Expand Down

0 comments on commit fcd14ec

Please sign in to comment.