diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index 98d512f67..0a26cf62c 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -34,23 +34,6 @@ //#define CLIP_DEBUG_FUNCTIONS -// RGB uint8 image -struct clip_image_u8 { - int nx; - int ny; - - std::vector buf; -}; - -// RGB float32 image (NHWC) -// Memory layout: RGBRGBRGB... -struct clip_image_f32 { - int nx; - int ny; - - std::vector buf; -}; - static std::string format(const char * fmt, ...) { va_list ap; va_list ap2; diff --git a/examples/llava/clip.h b/examples/llava/clip.h index e5bd54924..33f83490c 100644 --- a/examples/llava/clip.h +++ b/examples/llava/clip.h @@ -3,6 +3,7 @@ #include #include +#include #ifdef LLAMA_SHARED # if defined(_WIN32) && !defined(__MINGW32__) @@ -26,6 +27,23 @@ extern "C" { struct clip_ctx; +// RGB uint8 image +struct clip_image_u8 { + int nx; + int ny; + + std::vector buf; +}; + +// RGB float32 image (NHWC) +// Memory layout: RGBRGBRGB... +struct clip_image_f32 { + int nx; + int ny; + + std::vector buf; +}; + struct clip_image_u8_batch { struct clip_image_u8 * data; size_t size; diff --git a/examples/llava/llava.cpp b/examples/llava/llava.cpp index 4cb65a07b..9cb962936 100644 --- a/examples/llava/llava.cpp +++ b/examples/llava/llava.cpp @@ -9,23 +9,6 @@ #include #include -// RGB uint8 image -struct clip_image_u8 { - int nx; - int ny; - - std::vector buf; -}; - -// RGB float32 image (NHWC) -// Memory layout: RGBRGBRGB... -struct clip_image_f32 { - int nx; - int ny; - - std::vector buf; -}; - struct clip_image_grid_shape { int first; int second; diff --git a/examples/server/server.cpp b/examples/server/server.cpp index d002db9b9..4afcdb86f 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -32,14 +32,6 @@ using json = nlohmann::json; -// TODO should be in clip.h? -struct clip_image_u8 { - int nx; - int ny; - - std::vector buf; -}; - struct server_params { std::string hostname = "127.0.0.1";