[Fix] Fix AttributeError in Qwen2.5 LoRA: 'Qwen2ForCausalLM' object has no attribute 'get_hidden_dim' (#1536)

Co-authored-by: Ying Sheng <sqy1415@gmail.com>
This commit is contained in:
Minsang Song
2024-10-02 20:41:15 -07:00
committed by GitHub
co-authored by Ying Sheng
parent 4ae0969c0a
commit e6852b0dd2
4 changed files with 73 additions and 8 deletions
+1
View File
@@ -319,6 +319,7 @@ class LlamaForCausalLM(nn.Module):
)
def get_hidden_dim(self, module_name):
# return input_dim, output_dim
if module_name in ["q_proj", "o_proj", "qkv_proj"]:
return self.config.hidden_size, self.config.hidden_size
elif module_name in ["kv_proj"]: