From 1994dbcb5e62bd8d0c60e5d5d6bf4b580653c74c Mon Sep 17 00:00:00 2001 From: Vladislav Lyubimov <43727166+LyubimovVladislav@users.noreply.github.com> Date: Mon, 5 Jun 2023 13:55:37 +0300 Subject: [PATCH] Fix from_ckpt not working properly on windows (#3666) --- 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 e657406912..3c8081ccbb 100644 --- a/src/diffusers/loaders.py +++ b/src/diffusers/loaders.py @@ -1447,8 +1447,8 @@ class FromCkptMixin: 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/") :]