Skip to content

Commit cc45a7f

Browse files
authored
Fix crash of test-tokenizer-0 under Debug build (#2064)
* Fix crash of test-tokenizer-0 under Debug build * Change per comment
1 parent 55dbb91 commit cc45a7f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ggml-cuda.cu

+1-1
Original file line numberDiff line numberDiff line change
@@ -2835,7 +2835,7 @@ void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
28352835
}
28362836

28372837
void ggml_cuda_free_data(struct ggml_tensor * tensor) {
2838-
if (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) {
2838+
if (!tensor || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
28392839
return;
28402840
}
28412841

llama.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ struct llama_layer {
194194
};
195195

196196
struct llama_kv_cache {
197-
struct ggml_tensor * k;
198-
struct ggml_tensor * v;
197+
struct ggml_tensor * k = NULL;
198+
struct ggml_tensor * v = NULL;
199199

200200
struct ggml_context * ctx = NULL;
201201

0 commit comments

Comments
 (0)