From 9edbe232595848040d5c96fba9d99e506ca1eae6 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 2 May 2025 14:06:14 -0700 Subject: [PATCH] Bug fix --- unsloth/models/_utils.py | 2 +- unsloth/models/loader_utils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index cd8dd6d0de..cef886e9a4 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.4.6" +__version__ = "2025.4.7" __all__ = [ "SUPPORTS_BFLOAT16", diff --git a/unsloth/models/loader_utils.py b/unsloth/models/loader_utils.py index 49baae55df..db81b5c5c6 100644 --- a/unsloth/models/loader_utils.py +++ b/unsloth/models/loader_utils.py @@ -110,7 +110,8 @@ def get_model_name(model_name, load_in_4bit = True): ) # In the rare case, we convert bad model names to other names # For eg too large dynamic quants or MoEs - if new_model_name.lower() in BAD_MAPPINGS: + if new_model_name is not None and type(new_model_name) is str and \ + new_model_name.lower() in BAD_MAPPINGS: new_model_name = BAD_MAPPINGS[new_model_name.lower()] if new_model_name is None and model_name.count("/") == 1 and model_name[0].isalnum():