Skip to content

Commit

Permalink
copy to avoid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aciddelgado committed Dec 9, 2024
1 parent 4b12d57 commit 7a9b6bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/generators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ void Generator::ComputeLogits(DeviceSpan<int32_t> next_tokens) {
if (computed_logits_)
throw std::runtime_error("ComputeLogits called again without calling AppendTokens or GenerateNextToken first");

next_tokens.CopyDeviceToCpu();
auto logits = state_->Run(search_->GetSequenceLength(), next_tokens, search_->GetNextIndices());
if (g_log.enabled && g_log.model_logits) {
auto& stream = Log("model_logits");
Expand Down

0 comments on commit 7a9b6bb

Please sign in to comment.