From eb03e4111aa4e8f01a9dc00374f60c55eb2c0549 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 23 Jul 2024 11:23:18 -0700 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 474dad329e..aef04d604c 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -981,8 +981,16 @@ class LlamaRotaryEmbedding(torch.nn.Module): config = None, # [TODO] Hack to pass in config - need to remove later ): super().__init__() - if config is not None: return # [TODO] Hack to pass in config - need to remove later - + if config is not None: + # [TODO] Hack to pass in config - need to remove later + print(2) + base = config.rope_theta + partial_rotary_factor = config.partial_rotary_factor if hasattr(config, "partial_rotary_factor") else 1.0 + dim = int((config.hidden_size // config.num_attention_heads)) + device = "cuda" + max_position_embeddings = config.max_position_embeddings + pass + self.dim = dim self.max_position_embeddings = max_position_embeddings self.base = base