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", diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index 4566302ed0..7a6322d248 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 + elif 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