mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-03-15 05:57:20 +00:00
Remove duplicate text_projection key from some saved models.
This commit is contained in:
parent
8daedc5bf2
commit
37a86e4618
@ -240,7 +240,7 @@ def convert_text_enc_state_dict_v20(text_enc_dict, prefix=""):
|
|||||||
text_proj = "transformer.text_projection.weight"
|
text_proj = "transformer.text_projection.weight"
|
||||||
if k.endswith(text_proj):
|
if k.endswith(text_proj):
|
||||||
new_state_dict[k.replace(text_proj, "text_projection")] = v.transpose(0, 1).contiguous()
|
new_state_dict[k.replace(text_proj, "text_projection")] = v.transpose(0, 1).contiguous()
|
||||||
|
else:
|
||||||
relabelled_key = textenc_pattern.sub(lambda m: protected[re.escape(m.group(0))], k)
|
relabelled_key = textenc_pattern.sub(lambda m: protected[re.escape(m.group(0))], k)
|
||||||
new_state_dict[relabelled_key] = v
|
new_state_dict[relabelled_key] = v
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user