Skip to content

Commit

Permalink
make from_flax work for controlnet (huggingface#3161)
Browse files Browse the repository at this point in the history
fix from_flax

Co-authored-by: Patrick von Platen <[email protected]>
  • Loading branch information
yiyixuxu and patrickvonplaten authored Apr 21, 2023
1 parent 05d9bae commit bc0392a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/diffusers/models/modeling_pytorch_flax_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def load_flax_weights_in_pytorch_model(pt_model, flax_state):
.replace("_1", ".1")
.replace("_2", ".2")
.replace("_3", ".3")
.replace("_4", ".4")
.replace("_5", ".5")
.replace("_6", ".6")
.replace("_7", ".7")
.replace("_8", ".8")
.replace("_9", ".9")
)

flax_key = ".".join(flax_key_tuple_array)
Expand Down

0 comments on commit bc0392a

Please sign in to comment.