llama : for clarity set is_encoding to true before building worst-case graph only if the model contains encoder

This commit is contained in:
Stanisław Szymczyk 2024-08-10 10:32:15 +02:00
parent 788b4d199e
commit f356e27769

View file

@ -16706,7 +16706,8 @@ struct llama_context * llama_new_context_with_model(
ctx->sampling.rng = std::mt19937(params.seed); ctx->sampling.rng = std::mt19937(params.seed);
ctx->logits_all = params.logits_all; ctx->logits_all = params.logits_all;
ctx->is_encoding = true; // build worst-case graph for encoder if a model contains encoder
ctx->is_encoding = llama_model_has_encoder(model);
uint32_t kv_size = cparams.n_ctx; uint32_t kv_size = cparams.n_ctx;
ggml_type type_k = params.type_k; ggml_type type_k = params.type_k;