From d0c11b30b081a26dc22fb7cdcb2c6750316acc27 Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Mon, 19 Sep 2022 10:27:09 -0700 Subject: [PATCH] handle open clip adapter image size being a tuple --- dalle2_pytorch/dalle2_pytorch.py | 5 ++++- dalle2_pytorch/version.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dalle2_pytorch/dalle2_pytorch.py b/dalle2_pytorch/dalle2_pytorch.py index 5c6d6105..489a1f3c 100644 --- a/dalle2_pytorch/dalle2_pytorch.py +++ b/dalle2_pytorch/dalle2_pytorch.py @@ -406,7 +406,10 @@ def dim_latent(self): @property def image_size(self): - return self.clip.visual.image_size + image_size = self.clip.visual.image_size + if isinstance(image_size, tuple): + return max(image_size) + return image_size @property def image_channels(self): diff --git a/dalle2_pytorch/version.py b/dalle2_pytorch/version.py index 420b4d0e..37f0254f 100644 --- a/dalle2_pytorch/version.py +++ b/dalle2_pytorch/version.py @@ -1 +1 @@ -__version__ = '1.10.5' +__version__ = '1.10.6'