refactor: change default block_size in block size > max position embeddings (#26069)

* refactor: change default block_size when not initialize

* reformat: add the min of block size
This commit is contained in:
Phuc Van Phan
2023-09-18 22:47:57 +07:00
committed by GitHub
parent c63e27012d
commit 8b5da9fc6e

View File

@@ -574,9 +574,9 @@ def main():
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(