mirror of
https://github.com/lucidrains/DALLE2-pytorch.git
synced 2025-12-19 01:34:19 +01:00
fix openclipadapter to be able to use latest open sourced sota model
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from dalle2_pytorch.version import __version__
|
||||
from dalle2_pytorch.dalle2_pytorch import DALLE2, DiffusionPriorNetwork, DiffusionPrior, Unet, Decoder
|
||||
from dalle2_pytorch.dalle2_pytorch import OpenAIClipAdapter
|
||||
from dalle2_pytorch.dalle2_pytorch import OpenAIClipAdapter, OpenClipAdapter
|
||||
from dalle2_pytorch.trainer import DecoderTrainer, DiffusionPriorTrainer
|
||||
|
||||
from dalle2_pytorch.vqgan_vae import VQGanVAE
|
||||
|
||||
@@ -389,6 +389,8 @@ class OpenClipAdapter(BaseClipAdapter):
|
||||
self.eos_id = 49407
|
||||
|
||||
text_attention_final = self.find_layer('ln_final')
|
||||
self._dim_latent = text_attention_final.weight.shape[0]
|
||||
|
||||
self.handle = text_attention_final.register_forward_hook(self._hook)
|
||||
self.clip_normalize = preprocess.transforms[-1]
|
||||
self.cleared = False
|
||||
@@ -408,7 +410,7 @@ class OpenClipAdapter(BaseClipAdapter):
|
||||
|
||||
@property
|
||||
def dim_latent(self):
|
||||
return 512
|
||||
return self._dim_latent
|
||||
|
||||
@property
|
||||
def image_size(self):
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = '1.10.8'
|
||||
__version__ = '1.10.9'
|
||||
|
||||
Reference in New Issue
Block a user