diff --git a/src/llama-memory-hybrid.cpp b/src/llama-memory-hybrid.cpp index 15cde98d138a8..3d8b2db46705e 100644 --- a/src/llama-memory-hybrid.cpp +++ b/src/llama-memory-hybrid.cpp @@ -222,8 +222,12 @@ bool llama_memory_hybrid_context::apply() { bool res = true; - res = res & ctx_attn->apply(); - res = res & ctx_recr->apply(); + if (ctx_attn->get_status() == LLAMA_MEMORY_STATUS_SUCCESS) { + res = res & ctx_attn->apply(); + } + if (ctx_recr->get_status() == LLAMA_MEMORY_STATUS_SUCCESS) { + res = res & ctx_recr->apply(); + } return res; }