(weight)
| 186 | |
| 187 | # model.final_adaLN_modulation.1 -> norm_out.linear |
| 188 | def swap_scale_shift(weight): |
| 189 | shift, scale = weight.chunk(2, dim=0) |
| 190 | new_weight = torch.cat([scale, shift], dim=0) |
| 191 | return new_weight |
| 192 | |
| 193 | state_dict["norm_out.linear.weight"] = swap_scale_shift(state_dict["final_layer.adaLN_modulation.1.weight"]) |
| 194 | state_dict["norm_out.linear.bias"] = swap_scale_shift(state_dict["final_layer.adaLN_modulation.1.bias"]) |