From 4c0d482f6beb3f42fc31f401e8fb67dd7dc3e295 Mon Sep 17 00:00:00 2001 From: Vladislav Lyubimov Date: Sat, 3 Jun 2023 22:54:49 +0300 Subject: [PATCH] Fix from_ckpt not working properly on windows --- src/diffusers/loaders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diffusers/loaders.py b/src/diffusers/loaders.py index e657406912f2..3c8081ccbbbd 100644 --- a/src/diffusers/loaders.py +++ b/src/diffusers/loaders.py @@ -1447,8 +1447,8 @@ def from_ckpt(cls, pretrained_model_link_or_path, **kwargs): ckpt_path = Path(pretrained_model_link_or_path) if not ckpt_path.is_file(): # get repo_id and (potentially nested) file path of ckpt in repo - repo_id = str(Path().joinpath(*ckpt_path.parts[:2])) - file_path = str(Path().joinpath(*ckpt_path.parts[2:])) + repo_id = "/".join(ckpt_path.parts[:2]) + file_path = "/".join(ckpt_path.parts[2:]) if file_path.startswith("blob/"): file_path = file_path[len("blob/") :]