Skip to content

Commit

Permalink
fix une2td ignoring class_labels (huggingface#5401)
Browse files Browse the repository at this point in the history
* fix une2td ignoring class_labels

* unet2.py error message updated

* style and quality changes

---------

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
  • Loading branch information
kesimeg and DN6 authored Oct 20, 2023
1 parent e5e535f commit e34e866
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/unet_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ def forward(

class_emb = self.class_embedding(class_labels).to(dtype=self.dtype)
emb = emb + class_emb
elif self.class_embedding is None and class_labels is not None:
raise ValueError("class_embedding needs to be initialized in order to use class conditioning")

# 2. pre-process
skip_sample = sample
Expand Down

0 comments on commit e34e866

Please sign in to comment.