fix rope scaling

This commit is contained in:
hiyouga 2023-08-12 22:00:01 +08:00
parent 8a79ded55d
commit 8545c11c45
1 changed files with 3 additions and 3 deletions

View File

@ -102,11 +102,11 @@ def load_model_and_tokenizer(
)
current_max_length = getattr(config, "max_position_embeddings", None)
if current_max_length and model_args.model_max_length <= current_max_length:
if current_max_length and model_args.model_max_length > current_max_length:
scaling_factor = float(math.ceil(model_args.model_max_length / current_max_length))
else:
logger.warning("Input length is smaller than max length. Consider increase input length.")
scaling_factor = 1.0
else:
scaling_factor = float(math.ceil(model_args.model_max_length / current_max_length))
else:
scaling_factor = 2.0