MCPcopy Create free account
hub / github.com/THUDM/LongWriter / LlamaLinearScalingRotaryEmbedding

Class LlamaLinearScalingRotaryEmbedding

train/patch/modeling_llama.py:173–182  ·  view source on GitHub ↗

LlamaRotaryEmbedding extended with linear scaling. Credits to the Reddit user /u/kaiokendev

Source from the content-addressed store, hash-verified

171
172
173class LlamaLinearScalingRotaryEmbedding(LlamaRotaryEmbedding):
174 """LlamaRotaryEmbedding extended with linear scaling. Credits to the Reddit user /u/kaiokendev"""
175
176 def __init__(self, *args, **kwargs):
177 logger.warning_once(
178 "`LlamaLinearScalingRotaryEmbedding` is deprecated an will be removed in v4.45. Please use "
179 "`LlamaRotaryEmbedding`, which now also does linear scaling (simply pass the model config to __init__)."
180 )
181 kwargs["rope_type"] = "linear"
182 super().__init__(*args, **kwargs)
183
184
185class LlamaDynamicNTKScalingRotaryEmbedding(LlamaRotaryEmbedding):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected