Skip to content

Commit 53e100b

Browse files
committed
udapte
1 parent 63575af commit 53e100b

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
786786
# We retrieve the information by matching whether variant model checkpoints exist in the subfolders.
787787
# Example: `diffusion_pytorch_model.safetensors` -> `diffusion_pytorch_model.fp16.safetensors`
788788
# with variant being `"fp16"`.
789-
# TODO: adapt logic for DDUF files (at the moment, scans the local directory which doesn't make sense in DDUF context)
790789
model_variants = _identify_model_variants(folder=cached_folder, variant=variant, config=config_dict)
791790
if len(model_variants) == 0 and variant is not None:
792791
error_message = f"You are trying to load the model files of the `variant={variant}`, but no such modeling files are available."

src/diffusers/utils/dduf.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/diffusers/utils/hub_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ def _get_model_file(
297297
pretrained_model_name_or_path = str(pretrained_model_name_or_path)
298298

299299
if dduf_entries:
300-
if os.path.join(pretrained_model_name_or_path, weights_name) in dduf_entries:
301-
return os.path.join(pretrained_model_name_or_path, weights_name)
300+
if "/".join([pretrained_model_name_or_path, weights_name]) in dduf_entries:
301+
return "/".join([pretrained_model_name_or_path, weights_name])
302302
elif (
303303
subfolder is not None
304-
and os.path.join(pretrained_model_name_or_path, subfolder, weights_name) in dduf_entries
304+
and "/".join([pretrained_model_name_or_path, subfolder, weights_name]) in dduf_entries
305305
):
306-
return os.path.join(pretrained_model_name_or_path, weights_name)
306+
return "/".join([pretrained_model_name_or_path, subfolder, weights_name])
307307
else:
308308
raise EnvironmentError(f"Error no file named {weights_name} found in archive {dduf_entries.keys()}.")
309309
elif os.path.isfile(pretrained_model_name_or_path):

0 commit comments

Comments
 (0)