Update loader.py

This commit is contained in:
Daniel Han 2024-11-06 19:00:23 -08:00
commit 65ed76bac1

View file

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