Change per comment

This commit is contained in:
Howard Su 2023-07-03 20:12:40 +08:00
parent cc06f1171b
commit a75ddde952
2 changed files with 1 additions and 5 deletions

View file

@ -2809,7 +2809,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;
}

View file

@ -180,12 +180,8 @@ 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
}
};