Skip to content

Commit c4d4d60

Browse files
committed
fix open call
1 parent 0c472b2 commit c4d4d60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/models/model_loading_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def load_state_dict(checkpoint_file: Union[str, os.PathLike], variant: Optional[
140140
if file_extension == SAFETENSORS_FILE_EXTENSION:
141141
if no_mmap:
142142
logger.warning("fast load: " + str(checkpoint_file))
143-
return safetensors.torch.load(open(checkpoint_file, "rb"), device="cpu")
143+
return safetensors.torch.load(open(checkpoint_file, "rb").read())
144144
else:
145145
logger.warning("slow load: " + str(checkpoint_file))
146146
return safetensors.torch.load_file(checkpoint_file, device="cpu")

0 commit comments

Comments
 (0)