diff --git a/llmodel/gptj.cpp b/llmodel/gptj.cpp index d7057bd7..a5d04ae7 100644 --- a/llmodel/gptj.cpp +++ b/llmodel/gptj.cpp @@ -550,7 +550,7 @@ bool gptj_eval( struct ggml_tensor * Vcur = ggml_mul_mat(ctx0, model.layers[il].c_attn_v_proj_w, cur); // store key and value to memory - if (N >= 1) { + { struct ggml_tensor * k = ggml_view_1d(ctx0, model.kv_self.k, N*n_embd, (ggml_element_size(model.kv_self.k)*n_embd)*(il*n_ctx + n_past)); struct ggml_tensor * v = ggml_view_1d(ctx0, model.kv_self.v, N*n_embd, (ggml_element_size(model.kv_self.v)*n_embd)*(il*n_ctx + n_past));