diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index f73f0d3ec6..fbda4916e1 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -462,11 +462,11 @@ class FastModel(FastBaseModel): if token is None: token = get_token() SUPPORTS_BFLOAT16 = is_bfloat16_supported() - if dtype is None: - dtype = torch.float16 if not SUPPORTS_BFLOAT16 else torch.bfloat16 - elif dtype == torch.bfloat16 and not SUPPORTS_BFLOAT16: - logger.warning_once("Device does not support bfloat16. Will change to float16.") - dtype = torch.float16 + # if dtype is None: + # dtype = torch.float16 if not SUPPORTS_BFLOAT16 else torch.bfloat16 + # elif dtype == torch.bfloat16 and not SUPPORTS_BFLOAT16: + # logger.warning_once("Device does not support bfloat16. Will change to float16.") + # dtype = torch.float16 assert(dtype in (torch.float16, torch.bfloat16, torch.float32)) patch_compiled_autograd() diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 65b591adf4..bb6693e763 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -202,11 +202,11 @@ class FastBaseModel: get_statistics() # For debugging - we use a download counter to see if environments are not breaking - if dtype is None: - dtype = torch.float16 if not SUPPORTS_BFLOAT16 else torch.bfloat16 - elif dtype == torch.bfloat16 and not SUPPORTS_BFLOAT16: - logger.warning_once("Device does not support bfloat16. Will change to float16.") - dtype = torch.float16 + # if dtype is None: + # dtype = torch.float16 if not SUPPORTS_BFLOAT16 else torch.bfloat16 + # elif dtype == torch.bfloat16 and not SUPPORTS_BFLOAT16: + # logger.warning_once("Device does not support bfloat16. Will change to float16.") + # dtype = torch.float16 assert(dtype in (torch.float16, torch.bfloat16, torch.float32))