Skip to content

Commit 915c537

Browse files
authored
Revert error to warning when loading LoRA from repo with multiple weights (#11568)
1 parent 8270fa5 commit 915c537

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/loaders/lora_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ def _best_guess_weight_name(
299299
targeted_files = list(filter(lambda x: x.endswith(LORA_WEIGHT_NAME_SAFE), targeted_files))
300300

301301
if len(targeted_files) > 1:
302-
raise ValueError(
303-
f"Provided path contains more than one weights file in the {file_extension} format. Either specify `weight_name` in `load_lora_weights` or make sure there's only one `.safetensors` or `.bin` file in {pretrained_model_name_or_path_or_dict}."
302+
logger.warning(
303+
f"Provided path contains more than one weights file in the {file_extension} format. `{targeted_files[0]}` is going to be loaded, for precise control, specify a `weight_name` in `load_lora_weights`."
304304
)
305305
weight_name = targeted_files[0]
306306
return weight_name

0 commit comments

Comments
 (0)