Skip to content

Commit

Permalink
Make sure that indices are available on all relevant devices
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonwillard committed Oct 29, 2023
1 parent 95a9d97 commit c3421aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion outlines/text/generate/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def __call__(

if past_key_values:
unfinished_past_key_values = tuple(
tuple(vv[~local_is_finished] for vv in v) for v in past_key_values
tuple(vv[~local_is_finished.to(vv.device)] for vv in v)
for v in past_key_values
)

result = self.model.tokenizer.decode(token_ids[:, num_prompt_tokens:])
Expand Down

0 comments on commit c3421aa

Please sign in to comment.