Unverified Commit 73dac0c4 authored by zhangp365's avatar zhangp365 Committed by GitHub
Browse files

Fix a bug in the state dict judgment in ip_adapter.py. (#10095)



* fix a judging state dict bug in ip_adapter.py

* make

---------
Co-authored-by: default avatarhlky <hlky@hlky.ac>
parent 04bba387
...@@ -187,7 +187,7 @@ class IPAdapterMixin: ...@@ -187,7 +187,7 @@ class IPAdapterMixin:
state_dict = pretrained_model_name_or_path_or_dict state_dict = pretrained_model_name_or_path_or_dict
keys = list(state_dict.keys()) keys = list(state_dict.keys())
if keys != ["image_proj", "ip_adapter"]: if "image_proj" not in keys and "ip_adapter" not in keys:
raise ValueError("Required keys are (`image_proj` and `ip_adapter`) missing from the state dict.") raise ValueError("Required keys are (`image_proj` and `ip_adapter`) missing from the state dict.")
state_dicts.append(state_dict) state_dicts.append(state_dict)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment