diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index 14e02c8dd..6b2909484 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -6,6 +6,7 @@ #include "ggml.h" #include "ggml-alloc.h" #include "ggml-backend.h" +#include "log.h" #ifdef GGML_USE_CUDA #include "ggml-cuda.h" @@ -39,11 +40,6 @@ #include #include -#define LOG_INF(...) do { fprintf(stdout, __VA_ARGS__); } while (0) -#define LOG_WRN(...) do { fprintf(stderr, __VA_ARGS__); } while (0) -#define LOG_ERR(...) do { fprintf(stderr, __VA_ARGS__); } while (0) -#define LOG_DBG(...) do { fprintf(stderr, __VA_ARGS__); } while (0) - //#define CLIP_DEBUG_FUNCTIONS // RGB uint8 image diff --git a/examples/llava/llava-cli.cpp b/examples/llava/llava-cli.cpp index 161098585..6a3d798d0 100644 --- a/examples/llava/llava-cli.cpp +++ b/examples/llava/llava-cli.cpp @@ -203,7 +203,7 @@ static void process_prompt(struct llava_context * ctx_llava, struct llava_image_ response += tmp; if (strcmp(tmp, "") == 0) break; if (strstr(tmp, "###")) break; // Yi-VL behavior - LOG("%s", tmp); + printf("%s", tmp); if (strstr(response.c_str(), "<|im_end|>")) break; // Yi-34B llava-1.6 - for some reason those decode not as the correct token (tokenizer works) if (strstr(response.c_str(), "<|im_start|>")) break; // Yi-34B llava-1.6 if (strstr(response.c_str(), "USER:")) break; // mistral llava-1.6 @@ -212,7 +212,7 @@ static void process_prompt(struct llava_context * ctx_llava, struct llava_image_ } common_sampler_free(smpl); - LOG("\n"); + printf("\n"); } static struct llama_model * llava_init(common_params * params) { diff --git a/examples/llava/llava.cpp b/examples/llava/llava.cpp index be6988540..4b66d50eb 100644 --- a/examples/llava/llava.cpp +++ b/examples/llava/llava.cpp @@ -2,6 +2,7 @@ #include "llava.h" #include "llama.h" +#include "log.h" #include #include @@ -11,13 +12,8 @@ #include #include -#define die(msg) do { fputs("error: " msg "\n", stderr); exit(1); } while (0) -#define die_fmt(fmt, ...) do { fprintf(stderr, "error: " fmt "\n", __VA_ARGS__); exit(1); } while (0) - -#define LOG_INF(...) do { fprintf(stdout, __VA_ARGS__); } while (0) -#define LOG_WRN(...) do { fprintf(stderr, __VA_ARGS__); } while (0) -#define LOG_ERR(...) do { fprintf(stderr, __VA_ARGS__); } while (0) -#define LOG_DBG(...) do { fprintf(stdout, __VA_ARGS__); } while (0) +#define die(msg) do { LOG_ERR("%s", "error: " msg "\n"); exit(1); } while (0) +#define die_fmt(fmt, ...) do { LOG_ERR("error: " fmt "\n", __VA_ARGS__); exit(1); } while (0) // RGB uint8 image struct clip_image_u8 {