Skip to content

Commit

Permalink
Fix convert SD to diffusers error (open-mmlab#1979) (open-mmlab#2529)
Browse files Browse the repository at this point in the history
Fix convert sd 768 error (open-mmlab#1979)

Co-authored-by: tweeter0830 <tweeter0830@users.noreply.github.com>
  • Loading branch information
fkunn1326 and tweeter0830 authored Mar 2, 2023
1 parent d9b9533 commit 8f21a9f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,10 @@ def convert_open_clip_checkpoint(checkpoint):

text_model_dict = {}

d_model = int(checkpoint["cond_stage_model.model.text_projection"].shape[0])
if "cond_stage_model.model.text_projection" in checkpoint:
d_model = int(checkpoint["cond_stage_model.model.text_projection"].shape[0])
else:
d_model = 1024

text_model_dict["text_model.embeddings.position_ids"] = text_model.text_model.embeddings.get_buffer("position_ids")

Expand Down

0 comments on commit 8f21a9f

Please sign in to comment.