Fix .sft file loading (they are safetensors files).
This commit is contained in:
parent
5f98de7697
commit
eb96c3bd82
|
@ -11,7 +11,7 @@ import itertools
|
|||
def load_torch_file(ckpt, safe_load=False, device=None):
|
||||
if device is None:
|
||||
device = torch.device("cpu")
|
||||
if ckpt.lower().endswith(".safetensors"):
|
||||
if ckpt.lower().endswith(".safetensors") or ckpt.lower().endswith(".sft"):
|
||||
sd = safetensors.torch.load_file(ckpt, device=device.type)
|
||||
else:
|
||||
if safe_load:
|
||||
|
|
Loading…
Reference in New Issue