Skip to content

Commit

Permalink
[WIP] fix greedy
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbenayoun committed Oct 16, 2023
1 parent 81f631c commit 1f6cdd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/neuron/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def greedy_search(

# pre-process distribution
# Move to cpu to handle arbitrary logits_processor
next_tokens_scores = logits_processor(input_ids.clone().to("cpu")[:, :seq_length], next_token_logits.to("cpu"))
next_tokens_scores = logits_processor(input_ids.to("cpu")[:, :seq_length], next_token_logits.to("cpu"))
next_tokens_scores = next_tokens_scores.to(input_ids.device)

# Store scores, attentions and hidden_states when required
Expand Down

0 comments on commit 1f6cdd0

Please sign in to comment.