mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-15 08:08:09 +08:00
fix rope scaling
Former-commit-id: 2e0dd36700ec5e8294581c1db4b9431f755fc5f8
This commit is contained in:
parent
fc48bd8da0
commit
c95479dddb
@ -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