Skip to content

Commit

Permalink
Fix crash of test-tokenizer-0 under Debug build (ggerganov#2064)
Browse files Browse the repository at this point in the history
* Fix crash of test-tokenizer-0 under Debug build

* Change per comment
  • Loading branch information
howard0su committed Jul 3, 2023
1 parent 55dbb91 commit cc45a7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2835,7 +2835,7 @@ void ggml_cuda_transform_tensor(void * data, struct ggml_tensor * tensor) {
}

void ggml_cuda_free_data(struct ggml_tensor * tensor) {
if (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) {
if (!tensor || (tensor->backend != GGML_BACKEND_GPU && tensor->backend != GGML_BACKEND_GPU_SPLIT) ) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,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;

Expand Down

0 comments on commit cc45a7f

Please sign in to comment.