Skip to content

Commit

Permalink
Update ddpm.py (#59)
Browse files Browse the repository at this point in the history
In the personalized text generation image task, the  apply_model( ) method in the LatentDiffusionDB class under the path 'mindspore-tab/minddiffusion/blob/main/vision/wukonghua/ldm/models/differentiation/ddpm. py' reports an error: "TypeError: apply_model() got an unexpected keyword argument 'c_concat'"
  • Loading branch information
Yiwen2018311 committed May 2, 2023
1 parent 2b89373 commit d8926d2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions vision/wukong-huahua/ldm/models/diffusion/ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,7 @@ def construct(self, train_x, train_c, reg_x, reg_c):
def p_losses(self, x_start, cond, t, noise=None):
noise = msnp.randn(x_start.shape)
x_noisy = self.q_sample(x_start=x_start, t=t, noise=noise)
model_output = self.apply_model(x_noisy, t,
c_concat=cond if self.model.conditioning_key == 'concat' else None,
c_crossattn=cond if self.model.conditioning_key == 'crossattn' else None)
model_output = self.apply_model(x_noisy, t, cond)

if self.parameterization == "x0":
target = x_start
Expand Down

0 comments on commit d8926d2

Please sign in to comment.