Fix crash of test-tokenizer-0 under Debug build

This commit is contained in:
Howard Su 2023-07-01 22:37:26 +08:00
parent b8c8dda75f
commit cc06f1171b

View file

@ -165,8 +165,8 @@ struct llama_layer {
};
struct llama_kv_cache {
struct ggml_tensor * k;
struct ggml_tensor * v;
struct ggml_tensor * k = NULL;
struct ggml_tensor * v = NULL;
struct ggml_context * ctx = NULL;
@ -180,8 +180,12 @@ struct llama_kv_cache {
}
#ifdef GGML_USE_CUBLAS
if (k) {
ggml_cuda_free_data(k);
}
if (v) {
ggml_cuda_free_data(v);
}
#endif // GGML_USE_CUBLAS
}
};