From 42e09d192fb3d8a6e7b96563c0047fdd19585219 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 30 Jul 2024 19:56:36 -0700 Subject: [PATCH] bugs --- unsloth/models/_utils.py | 28 ++++++++++++++-------------- unsloth/models/loader.py | 1 + unsloth/models/mapper.py | 1 + 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 994f97ab73..8677879aad 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -178,20 +178,20 @@ from transformers.models.llama.modeling_llama import logger # Get Xformers from xformers import __version__ as xformers_version # Temporarily disable 0.0.27 and higher - inference issues -if Version(xformers_version) >= Version("0.0.27"): - raise ImportError( - "Unsloth: If you are in Colab, we updated the top cell install instructions - please change it to below "\ - "then press Disconnect Runtime and then Restart it.\n"\ - "\n"\ - "%%capture\n" - "# Installs Unsloth, Xformers (Flash Attention) and all other packages!\n" - '!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"\n' - '!pip install --no-deps "xformers<0.0.27" "trl<0.9.0" peft accelerate bitsandbytes\n'\ - '\n'\ - f"Otherwise in local machines, your xformers version of {xformers_version} is too new.\n"\ - 'Please downgrade xformers via `pip install --force-reinstall "xformers<0.0.27"' - ) -pass +# if Version(xformers_version) >= Version("0.0.27"): +# raise ImportError( +# "Unsloth: If you are in Colab, we updated the top cell install instructions - please change it to below "\ +# "then press Disconnect Runtime and then Restart it.\n"\ +# "\n"\ +# "%%capture\n" +# "# Installs Unsloth, Xformers (Flash Attention) and all other packages!\n" +# '!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"\n' +# '!pip install --no-deps "xformers<0.0.27" "trl<0.9.0" peft accelerate bitsandbytes\n'\ +# '\n'\ +# f"Otherwise in local machines, your xformers version of {xformers_version} is too new.\n"\ +# 'Please downgrade xformers via `pip install --force-reinstall "xformers<0.0.27"' +# ) +# pass if Version(torch_version) < Version("2.2.0") and Version(xformers_version) >= Version("0.0.24"): raise ImportError( diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index f22e81efad..fb6d5c5018 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -42,6 +42,7 @@ def __get_model_name( FLOAT_TO_INT_MAPPER = None, ): + model_name = str(model_name) if not SUPPORTS_FOURBIT and model_name.lower() in INT_TO_FLOAT_MAPPER: model_name = INT_TO_FLOAT_MAPPER[model_name.lower()] logger.warning_once( diff --git a/unsloth/models/mapper.py b/unsloth/models/mapper.py index 462555f317..254a68a420 100644 --- a/unsloth/models/mapper.py +++ b/unsloth/models/mapper.py @@ -67,6 +67,7 @@ __INT_TO_FLOAT_MAPPER = \ "codellama/CodeLlama-7b-hf", ), "unsloth/codellama-13b-bnb-4bit" : ( + "unsloth/codellama-13b", "codellama/CodeLlama-13b-hf", ), "unsloth/yi-6b-bnb-4bit" : (