Skip to content

Commit 8581d9b

Browse files
gzguevarasayakpaul
andauthored
changed to posix unet (#6719)
changed to posix Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
1 parent c101066 commit 8581d9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/diffusers/loaders/unet.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from collections import defaultdict
1717
from contextlib import nullcontext
1818
from functools import partial
19+
from pathlib import Path
1920
from typing import Callable, Dict, List, Optional, Union
2021

2122
import safetensors
@@ -503,8 +504,9 @@ def save_function(weights, filename):
503504
weight_name = CUSTOM_DIFFUSION_WEIGHT_NAME if is_custom_diffusion else LORA_WEIGHT_NAME
504505

505506
# Save the model
506-
save_function(state_dict, os.path.join(save_directory, weight_name))
507-
logger.info(f"Model weights saved in {os.path.join(save_directory, weight_name)}")
507+
save_path = Path(save_directory, weight_name).as_posix()
508+
save_function(state_dict, save_path)
509+
logger.info(f"Model weights saved in {save_path}")
508510

509511
def fuse_lora(self, lora_scale=1.0, safe_fusing=False, adapter_names=None):
510512
self.lora_scale = lora_scale

0 commit comments

Comments
 (0)