Skip to content

Commit

Permalink
common : call llama_decode() during warmup only if the model has decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
sszymczy committed Aug 9, 2024
1 parent 94597ec commit 788b4d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,9 @@ struct llama_init_result llama_init_from_gpt_params(gpt_params & params) {
tmp.clear();
tmp.push_back(decoder_start_token_id);
}
llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch), 0, 0));
if (llama_model_has_decoder(model)) {
llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch), 0, 0));
}
llama_kv_cache_clear(lctx);
llama_synchronize(lctx);
llama_reset_timings(lctx);
Expand Down

0 comments on commit 788b4d1

Please sign in to comment.