Commit b01011d2 authored by zhuwenwen's avatar zhuwenwen
Browse files

update scaling_alpha

parent f386ba88
...@@ -1871,8 +1871,8 @@ def _get_and_verify_max_len( ...@@ -1871,8 +1871,8 @@ def _get_and_verify_max_len(
"original_max_position_embeddings"] "original_max_position_embeddings"]
# see DynamicNTKAlphaRotaryEmbedding # see DynamicNTKAlphaRotaryEmbedding
if rope_scaling["type"] == "dynamic" and "alpha" in rope_scaling: # if "alpha" in rope_scaling and rope_scaling["type"] == "dynamic":
scaling_factor = 1 # scaling_factor = 1
derived_max_model_len *= scaling_factor derived_max_model_len *= scaling_factor
......
...@@ -137,10 +137,11 @@ def get_rope( ...@@ -137,10 +137,11 @@ def get_rope(
scaling_alpha, dtype) scaling_alpha, dtype)
elif "factor" in rope_scaling: elif "factor" in rope_scaling:
scaling_factor = rope_scaling["factor"] scaling_factor = rope_scaling["factor"]
if "alpha" in rope_scaling: scaling_alpha = rope_scaling["alpha"]
if scaling_alpha:
rotary_emb = DynamicNTKAlphaRotaryEmbedding( rotary_emb = DynamicNTKAlphaRotaryEmbedding(
head_size, rotary_dim, max_position, base, is_neox_style, head_size, rotary_dim, max_position, base, is_neox_style,
rope_scaling["alpha"], dtype) scaling_alpha, dtype)
else: else:
rotary_emb = DynamicNTKScalingRotaryEmbedding( rotary_emb = DynamicNTKScalingRotaryEmbedding(
head_size, rotary_dim, max_position, base, is_neox_style, head_size, rotary_dim, max_position, base, is_neox_style,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment