mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 12:42:51 +08:00
fix rope scaling
Former-commit-id: 8545c11c45906b33c78e144c2338963eaf0406b8
This commit is contained in:
parent
2bcf0025d6
commit
bd611e0090
@ -102,11 +102,11 @@ def load_model_and_tokenizer(
|
|||||||
)
|
)
|
||||||
|
|
||||||
current_max_length = getattr(config, "max_position_embeddings", None)
|
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.")
|
logger.warning("Input length is smaller than max length. Consider increase input length.")
|
||||||
scaling_factor = 1.0
|
scaling_factor = 1.0
|
||||||
else:
|
|
||||||
scaling_factor = float(math.ceil(model_args.model_max_length / current_max_length))
|
|
||||||
else:
|
else:
|
||||||
scaling_factor = 2.0
|
scaling_factor = 2.0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user