Skip to content

Commit

Permalink
less important but align to beam_search
Browse files Browse the repository at this point in the history
  • Loading branch information
vince62s committed Oct 20, 2023
1 parent 7a2d8a4 commit 5743fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onmt/translate/greedy_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def update_finished(self):
best_hyp = sorted(self.hypotheses[b], key=lambda x: x[0], reverse=True)
for score, pred, attn in best_hyp:
self.scores[b].append(score)
self.predictions[b].append(pred)
self.predictions[b].append(pred.cpu())
self.attention[b].append(attn)
return
is_alive = ~self.is_finished.view(-1)
Expand Down

0 comments on commit 5743fae

Please sign in to comment.