Adapting txt logging for python 3.8

This commit is contained in:
Tim
2023-06-25 16:42:45 -07:00
parent 58ddbee3ee
commit a1af4ac4f1

View File

@@ -258,14 +258,10 @@ class DiffusionEngine(pl.LightningModule):
xc = log_txt_as_img((image_h, image_w), x, size=image_h // 20) xc = log_txt_as_img((image_h, image_w), x, size=image_h // 20)
else: else:
raise NotImplementedError() raise NotImplementedError()
elif isinstance(x, Union[List, ListConfig]): elif isinstance(x, (List, ListConfig)):
if isinstance(x[0], str): if isinstance(x[0], str):
# strings # strings
xc = log_txt_as_img((image_h, image_w), x, size=image_h // 20) 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: else:
raise NotImplementedError() raise NotImplementedError()
else: else: