Skip to content

Commit 3b0d84d

Browse files
committed
fix
1 parent 5217712 commit 3b0d84d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/diffusers/configuration_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,14 @@ def load_config(
360360
"`ConfigMixin`. Please make sure to define `config_name` in a class inheriting from `ConfigMixin`"
361361
)
362362
# Custom path for now
363+
if dduf_entries:
363364
if subfolder is not None:
364-
config_file = if os.path.join(pretrained_model_name_or_path, subfolder, cls.config_name) in dduf_entries
365+
config_file = os.path.join(pretrained_model_name_or_path, subfolder, cls.config_name)
365366
else:
366-
config_file = if os.path.join(pretrained_model_name_or_path, cls.config_name)
367-
if config_filepath not in dduf_entries:
367+
config_file = os.path.join(pretrained_model_name_or_path, cls.config_name)
368+
if config_file not in dduf_entries:
368369
raise ValueError(
369-
f"We did not manage to find the file {os.path.join(pretrained_model_name_or_path, subfolder, cls.config_name)} in the dduf file. We only have the following files {dduf_entries.keys()}"
370+
f"We did not manage to find the file {config_file} in the dduf file. We only have the following files {dduf_entries.keys()}"
370371
)
371372
elif os.path.isfile(pretrained_model_name_or_path):
372373
config_file = pretrained_model_name_or_path

0 commit comments

Comments
 (0)