Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc18c080

Browse files
committed
fix for use with larger openai clip models by extracting dimension of last layernorm in clip
1 parentb39653c commitc18c080

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎dalle2_pytorch/dalle2_pytorch.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ def __init__(
314314
self.eos_id=49407# for handling 0 being also '!'
315315

316316
text_attention_final=self.find_layer('ln_final')
317+
318+
self.dim_latent_=text_attention_final.weight.shape[0]
317319
self.handle=text_attention_final.register_forward_hook(self._hook)
320+
318321
self.clip_normalize=preprocess.transforms[-1]
319322
self.cleared=False
320323

@@ -333,7 +336,7 @@ def _hook(self, _, inputs, outputs):
333336

334337
@property
335338
defdim_latent(self):
336-
return512
339+
returnself.dim_latent_
337340

338341
@property
339342
defimage_size(self):

‎dalle2_pytorch/version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__='1.10.6'
1+
__version__='1.10.7'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp