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

Commit683dd98

Browse files
committed
extra insurance in case eos id is not there
1 parent067ac32 commit683dd98

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

‎dalle2_pytorch/dalle2_pytorch.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ def embed_text(self, text):
360360
is_eos_id= (text==self.eos_id)
361361
text_mask_excluding_eos=is_eos_id.cumsum(dim=-1)==0
362362
text_mask=F.pad(text_mask_excluding_eos, (1,-1),value=True)
363+
text_mask=text_mask& (text!=0)
363364
assertnotself.cleared
364365

365366
text_embed=self.clip.encode_text(text)
@@ -434,6 +435,7 @@ def embed_text(self, text):
434435
is_eos_id= (text==self.eos_id)
435436
text_mask_excluding_eos=is_eos_id.cumsum(dim=-1)==0
436437
text_mask=F.pad(text_mask_excluding_eos, (1,-1),value=True)
438+
text_mask=text_mask& (text!=0)
437439
assertnotself.cleared
438440

439441
text_embed=self.clip.encode_text(text)

‎dalle2_pytorch/version.py‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp