Skip to content

Commit

Permalink
stop gap measure for supporting classifier free guidance condition sc…
Browse files Browse the repository at this point in the history
…aling without kv cache
  • Loading branch information
lucidrains committed Dec 17, 2023
1 parent 919936d commit cee61b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions meshgpt_pytorch/meshgpt_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,18 +1090,21 @@ def generate(

can_eos = i != 0 and divisible_by(i, self.num_quantizers * 3) # only allow for eos to be decoded at the end of each face, defined as 3 vertices with D residual VQ codes

logits, new_cache = self.forward_on_codes(
output = self.forward_on_codes(
codes,
cache = cache,
text_embeds = text_embeds,
return_loss = False,
return_cache = True,
return_cache = can_cache,
append_eos = False,
cond_scale = cond_scale
)

if can_cache:
logits, cache = output
cache = new_cache
else:
logits = output

logits = logits[:, -1]

Expand Down
2 changes: 1 addition & 1 deletion meshgpt_pytorch/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.17'
__version__ = '0.3.18'

0 comments on commit cee61b4

Please sign in to comment.