1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

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: apolinario <joaopaulo.passos+multimodal@gmail.com>
This commit is contained in:
apolinario
2022-12-13 12:44:20 +01:00
committed by GitHub
parent 40c16ed2f0
commit b417042291

View File

@@ -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()