Update loader.py

This commit is contained in:
Daniel Han 2024-11-06 19:00:13 -08:00
commit a8ddc39482

View file

@ -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