Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jul 25, 2024
1 parent f24863f commit 6d797df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions autoregressive_diffusion_pytorch/autoregressive_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,10 @@ def sample(
for _ in tqdm(range(self.max_seq_len - out.shape[1]), desc = 'tokens'):

cond = self.proj_in(out)
cond = cond + self.abs_pos_emb(torch.arange(cond.shape[1], device = self.device))

cond = torch.cat((start_tokens, cond), dim = 1)
cond = cond + self.abs_pos_emb(torch.arange(cond.shape[1], device = self.device))

cond = self.transformer(cond)

last_cond = cond[:, -1]
Expand Down Expand Up @@ -494,8 +495,8 @@ def forward(

seq = self.proj_in(seq)
start_token = repeat(self.start_token, 'd -> b 1 d', b = b)
seq = torch.cat((start_token, seq), dim = 1)

seq = torch.cat((start_token, seq), dim = 1)
seq = seq + self.abs_pos_emb(torch.arange(seq_len, device = self.device))

cond = self.transformer(seq)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "autoregressive-diffusion-pytorch"
version = "0.0.6"
version = "0.1.0"
description = "Autoregressive Diffusion - Pytorch"
authors = [
{ name = "Phil Wang", email = "[email protected]" }
Expand Down

0 comments on commit 6d797df

Please sign in to comment.