diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 9c9b45dbae..ea5dabf738 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1782,10 +1782,12 @@ class FastLlamaModel: layer.self_attn.apply_qkv = apply_lora_qkv n_qkv += 1 else: - logger.warning_once( - "Not an error, but Unsloth cannot patch Attention layers with our manual autograd engine since either LoRA adapters\n"\ - "are not enabled or a bias term (like in Qwen) is used." - ) + if model_type != "qwen2": + logger.warning_once( + "Not an error, but Unsloth cannot patch Attention layers with our manual autograd engine since either LoRA adapters\n"\ + "are not enabled or a bias term (like in Qwen) is used." + ) + pass pass # O attention patching diff --git a/unsloth/models/mapper.py b/unsloth/models/mapper.py index 777f310c73..8808b8554d 100644 --- a/unsloth/models/mapper.py +++ b/unsloth/models/mapper.py @@ -156,6 +156,36 @@ __INT_TO_FLOAT_MAPPER = \ "unsloth/Phi-3-medium-4k-instruct", "microsoft/Phi-3-medium-4k-instruct", ), + "unsloth/Qwen2-0.5B-bnb-4bit" : ( + "unsloth/Qwen2-0.5B", + "Qwen/Qwen2-0.5B", + ), + "unsloth/Qwen2-0.5B-Instruct-bnb-4bit" : ( + "unsloth/Qwen2-0.5B-Instruct", + "Qwen/Qwen2-0.5B-Instruct", + ), + "unsloth/Qwen2-1.5B-bnb-4bit" : ( + "unsloth/Qwen2-1.5B", + "Qwen/Qwen2-1.5B", + ), + "unsloth/Qwen2-1.5B-Instruct-bnb-4bit" : ( + "unsloth/Qwen2-1.5B-Instruct", + "Qwen/Qwen2-1.5B-Instruct", + ), + "unsloth/Qwen2-7B-bnb-4bit" : ( + "unsloth/Qwen2-7B", + "Qwen/Qwen2-7B", + ), + "unsloth/Qwen2-7B-Instruct-bnb-4bit" : ( + "unsloth/Qwen2-7B-Instruct", + "Qwen/Qwen2-7B-Instruct", + ), + "unsloth/Qwen2-70B-bnb-4bit" : ( + "Qwen/Qwen2-70B", + ), + "unsloth/Qwen2-70B-Instruct-bnb-4bit" : ( + "Qwen/Qwen2-70B-Instruct", + ), } INT_TO_FLOAT_MAPPER = {}