Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jun 24, 2022
1 parent b301b74 commit e7a31c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions parti_pytorch/parti_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def generate(

image_tokens = torch.empty((batch, 0), device = device, dtype = torch.long)

for _ in range(image_seq_len + 1):
for _ in range(image_seq_len):
logits = self.forward_with_cond_scale(
text_token_embeds = text_token_embeds,
text_mask = text_mask,
Expand All @@ -314,8 +314,6 @@ def generate(
sampled = rearrange(sampled, 'b -> b 1')
image_tokens = torch.cat((image_tokens, sampled), dim = -1)

image_tokens = image_tokens[:, 1:] # remove start token

image_tokens = rearrange(image_tokens, 'b (h w) -> b h w', h = self.image_encoded_dim)

if not exists(self.vae):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'parti-pytorch',
packages = find_packages(exclude=[]),
version = '0.0.5',
version = '0.0.6',
license='MIT',
description = 'Parti - Pathways Autoregressive Text-to-Image Model - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit e7a31c2

Please sign in to comment.