Skip to content

Commit

Permalink
added clone to fix prefill issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Chillee committed May 5, 2024
1 parent 30d69b3 commit 2c33914
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def generate(
seq = empty
input_pos = torch.arange(0, T, device=device)

next_token = prefill(model, prompt.view(1, -1), input_pos, **sampling_kwargs)
next_token = prefill(model, prompt.view(1, -1), input_pos, **sampling_kwargs).clone()
if is_speculative:
prefill(draft_model, prompt.view(1, -1), input_pos, **sampling_kwargs)
seq[T] = next_token
Expand Down

0 comments on commit 2c33914

Please sign in to comment.