Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Mar 10, 2025
1 parent 3e45ea4 commit d95c01a
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions examples/llava/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@
#include "ggml-backend.h"
#include "gguf.h"

#ifdef GGML_USE_CUDA
#include "ggml-cuda.h"
#endif

#ifdef GGML_USE_SYCL
#include "ggml-sycl.h"
#endif

#ifdef GGML_USE_METAL
#include "ggml-metal.h"
#endif

#ifdef GGML_USE_CANN
#include "ggml-cann.h"
#endif

#ifdef GGML_USE_VULKAN
#include "ggml-vulkan.h"
#endif

#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"

Expand Down Expand Up @@ -641,19 +621,11 @@ struct clip_ctx {
}

~clip_ctx() {
if (ctx_data) {
ggml_free(ctx_data);
}
if (ctx_gguf) {
gguf_free(ctx_gguf);
}
if (buf) {
ggml_backend_buffer_free(buf);
}
if (backend) {
ggml_backend_free(backend);
}
if (backend_cpu && backend_cpu != backend) {
ggml_free(ctx_data);
gguf_free(ctx_gguf);
ggml_backend_buffer_free(buf);
ggml_backend_free(backend);
if (backend_cpu != backend) {
ggml_backend_free(backend_cpu);
}
}
Expand Down

0 comments on commit d95c01a

Please sign in to comment.