From a8ddc39482a39f13a4dce2458ee15370fd7f797c Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 6 Nov 2024 19:00:13 -0800 Subject: [PATCH 1/3] Update loader.py --- unsloth/models/loader.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 4566302ed0..0414d54460 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -54,11 +54,11 @@ def _get_dtype(dtype): "bfloat16": torch.bfloat16, torch.bfloat16: torch.bfloat16, } - if dtype in __DTYPE_MAP: - return __DTYPE_MAP[dtype] + if dtype is None or dtype == None: return None + if dtype in __DTYPE_MAP: return __DTYPE_MAP[dtype] else: - print(f"Unsloth: {dtype} is not recognized, so we'll default to torch.float16") - return torch.float16 + print(f"Unsloth: {dtype} is not recognized, so we'll default to None") + return None pass pass From 01cd5b33703ce150e94b138e26bd953b5fe177a7 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 6 Nov 2024 19:00:23 -0800 Subject: [PATCH 2/3] Update loader.py --- unsloth/models/loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 0414d54460..7a6322d248 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -54,8 +54,8 @@ def _get_dtype(dtype): "bfloat16": torch.bfloat16, torch.bfloat16: torch.bfloat16, } - if dtype is None or dtype == None: return None - if dtype in __DTYPE_MAP: return __DTYPE_MAP[dtype] + if dtype is None or dtype == None: return None + elif dtype in __DTYPE_MAP: return __DTYPE_MAP[dtype] else: print(f"Unsloth: {dtype} is not recognized, so we'll default to None") return None From a93762532df85b4407c04d101a78401487df6aff Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 6 Nov 2024 19:00:42 -0800 Subject: [PATCH 3/3] Update _utils.py --- unsloth/models/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index a6cd13d251..5fff96642d 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__ = "2024.11.4" +__version__ = "2024.11.5" __all__ = [ "prepare_model_for_kbit_training",