[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:
@@ -51,6 +51,7 @@ CI_MODELS = [
|
||||
# All other models
|
||||
ALL_OTHER_MODELS = [
|
||||
ModelCase("Qwen/Qwen2-1.5B"),
|
||||
ModelCase("Qwen/Qwen2.5-14B-Instruct"),
|
||||
ModelCase("HuggingFaceTB/SmolLM-135M-Instruct"),
|
||||
]
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ LORA_SETS = [
|
||||
# "loras": ["RuterNorway/Llama-2-7b-chat-norwegian-LoRa"],
|
||||
# },
|
||||
{"base": "meta-llama/Llama-2-7b-hf", "loras": ["winddude/wizardLM-LlaMA-LoRA-7B"]},
|
||||
# {"base": "Qwen/Qwen2.5-14B-Instruct", "loras": ["mssongit/Qwen2.5-14B-SFT-LoRA"]},
|
||||
# {"base": "mistralai/Mistral-7B-Instruct-v0.3", "loras": ["/home/ying/test_lora"]},
|
||||
# {
|
||||
# "base": "mistralai/Mistral-7B-Instruct-v0.3",
|
||||
@@ -170,7 +171,7 @@ class TestLoRA(unittest.TestCase):
|
||||
print(f"{srt_no_lora_outputs.output_strs=}")
|
||||
for i in range(len(prompts)):
|
||||
assert srt_outputs.output_strs[i].strip(" ") == hf_outputs.output_strs[i], (
|
||||
str_outputs.output_strs[i].strip(" "),
|
||||
srt_outputs.output_strs[i].strip(" "),
|
||||
hf_outputs.output_strs[i],
|
||||
)
|
||||
# assert (
|
||||
@@ -264,7 +265,7 @@ class TestLoRA(unittest.TestCase):
|
||||
|
||||
for i in range(len(prompts)):
|
||||
assert srt_outputs.output_strs[i].strip(" ") == hf_outputs.output_strs[i], (
|
||||
str_outputs.output_strs[i].strip(" "),
|
||||
srt_outputs.output_strs[i].strip(" "),
|
||||
hf_outputs.output_strs[i],
|
||||
)
|
||||
assert (
|
||||
|
||||
Reference in New Issue
Block a user