Unverified Commit b4170422 authored by apolinario's avatar apolinario Committed by GitHub
Browse files

Fix wrong type checking in `convert_diffusers_to_original_stable_diffusion.py` (#1681)



* Fix type checking remainders

* Remove IS_V20_MODEL flag always being True
Co-authored-by: default avatarapolinario <joaopaulo.passos+multimodal@gmail.com>
parent 40c16ed2
......@@ -209,7 +209,7 @@ textenc_pattern = re.compile("|".join(protected.keys()))
code2idx = {"q": 0, "k": 1, "v": 2}
def convert_text_enc_state_dict_v20(text_enc_dict: dict[str, torch.Tensor]):
def convert_text_enc_state_dict_v20(text_enc_dict):
new_state_dict = {}
capture_qkv_weight = {}
capture_qkv_bias = {}
......@@ -256,12 +256,10 @@ def convert_text_enc_state_dict_v20(text_enc_dict: dict[str, torch.Tensor]):
return new_state_dict
def convert_text_enc_state_dict(text_enc_dict: dict[str, torch.Tensor]):
def convert_text_enc_state_dict(text_enc_dict):
return text_enc_dict
IS_V20_MODEL = True
if __name__ == "__main__":
parser = argparse.ArgumentParser()
......
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