Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash of test-tokenizer-0 under Debug build #2064

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix crash of test-tokenizer-0 under Debug build
  • Loading branch information
howard0su committed Jul 2, 2023
commit cc06f1171ba61690992fcb7e15dd0beff30822ac
8 changes: 6 additions & 2 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
}
};
Expand Down