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():