Skip to content

Commit

Permalink
Adapting txt logging for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
timudk committed Jun 25, 2023
1 parent 58ddbee commit a1af4ac
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sgm/models/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,10 @@ def log_conditionings(self, batch: Dict, n: int) -> Dict:
xc = log_txt_as_img((image_h, image_w), x, size=image_h // 20)
else:
raise NotImplementedError()
elif isinstance(x, Union[List, ListConfig]):
elif isinstance(x, (List, ListConfig)):
if isinstance(x[0], str):
# strings
xc = log_txt_as_img((image_h, image_w), x, size=image_h // 20)
elif isinstance(x[0], Union[ListConfig, List]):
# # case: videos processed
x = [xx[0] for xx in x]
xc = log_txt_as_img((image_h, image_w), x, size=image_h // 20)
else:
raise NotImplementedError()
else:
Expand Down

0 comments on commit a1af4ac

Please sign in to comment.