Skip to content

Commit 92070ca

Browse files
committed
Maybe adding a memory leak? But it werks now.
1 parent 7dbed97 commit 92070ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llama.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,7 @@ struct llama_control_vector {
19501950
}
19511951

19521952
~llama_control_vector() {
1953+
LLAMA_LOG_ERROR("Kill the control vector\n");
19531954
for (struct ggml_context * ctx : ctxs) {
19541955
ggml_free(ctx);
19551956
}
@@ -13994,9 +13995,9 @@ int32_t llama_model_apply_lora_from_file(const struct llama_model * model, const
1399413995
}
1399513996

1399613997
static bool llama_control_vector_init(struct llama_control_vector & cvec, const llama_model & model) {
13997-
GGML_ASSERT(cvec.tensors.empty());
13998-
GGML_ASSERT(cvec.ctxs.empty());
13999-
GGML_ASSERT(cvec.bufs.empty());
13998+
cvec.tensors.clear();
13999+
cvec.ctxs.clear();
14000+
cvec.bufs.clear();
1400014001

1400114002
// count layer buffer types
1400214003
std::map<ggml_backend_buffer_type_t, int> buft_layer_count;
@@ -14062,10 +14063,9 @@ int32_t llama_control_vector_apply(struct llama_context * lctx, const float * da
1406214063
return 1;
1406314064
}
1406414065

14065-
if (cvec.tensors.empty()) {
14066-
if (!llama_control_vector_init(cvec, model)) {
14067-
return 1;
14068-
}
14066+
if (!llama_control_vector_init(cvec, model)) {
14067+
LLAMA_LOG_ERROR("%s: FUCKING BITCH\n", __func__);
14068+
return 1;
1406914069
}
1407014070

1407114071
cvec.layer_start = il_start;

0 commit comments

Comments
 (0)