Skip to content

Commit 9908609

Browse files
authored
change to posix for better Windows support for lora loaders (#6590)
* posix lora * changes and style fix
1 parent 23eed39 commit 9908609

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/diffusers/loaders/lora.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import inspect
1515
import os
1616
from contextlib import nullcontext
17+
from pathlib import Path
1718
from typing import Callable, Dict, List, Optional, Union
1819

1920
import safetensors
@@ -960,8 +961,9 @@ def save_function(weights, filename):
960961
else:
961962
weight_name = LORA_WEIGHT_NAME
962963

963-
save_function(state_dict, os.path.join(save_directory, weight_name))
964-
logger.info(f"Model weights saved in {os.path.join(save_directory, weight_name)}")
964+
save_path = Path(save_directory, weight_name).as_posix()
965+
save_function(state_dict, save_path)
966+
logger.info(f"Model weights saved in {save_path}")
965967

966968
def unload_lora_weights(self):
967969
"""

0 commit comments

Comments
 (0)