From 32bf7bf61f8ebdf04e683977c0a455161563a963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Yusuf=20Sar=C4=B1g=C3=B6z?= Date: Sun, 5 Nov 2023 15:33:16 +0300 Subject: [PATCH] Editorconfig --- CMakeLists.txt | 2 +- examples/llava/clip.cpp | 2 +- examples/llava/llava-utils.h | 2 +- examples/llava/llava.cpp | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4f5c01a..4362570f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -686,7 +686,7 @@ if (BUILD_SHARED_LIBS) # By default, symbols provided by the sublibs that are not used by mainlib (which is all of them in this case) # are not used. This changes that. - if (WIN32) + if (WIN32) set_target_properties(llama PROPERTIES LINK_FLAGS "/WHOLEARCHIVE" ) diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index 92e19346f..3c909c7d3 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -680,7 +680,7 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) { return new_clip; } -clip_image_u8 * make_clip_image_u8() { +clip_image_u8 * make_clip_image_u8() { auto img = new clip_image_u8(); return img; } diff --git a/examples/llava/llava-utils.h b/examples/llava/llava-utils.h index 5d7da63fd..aa6f0304c 100644 --- a/examples/llava/llava-utils.h +++ b/examples/llava/llava-utils.h @@ -165,7 +165,7 @@ inline bool prompt_contains_image(const std::string& prompt) { } // replaces the base64 image tag in the prompt with `replacement` -inline llava_image_embed * llava_image_embed_make_with_prompt_base64(struct clip_ctx * ctx_clip, int n_threads, const std::string& prompt) { +inline llava_image_embed * llava_image_embed_make_with_prompt_base64(struct clip_ctx * ctx_clip, int n_threads, const std::string& prompt) { size_t img_base64_str_start, img_base64_str_end; find_image_tag_in_prompt(prompt, img_base64_str_start, img_base64_str_end); if (img_base64_str_start == std::string::npos || img_base64_str_end == std::string::npos) { diff --git a/examples/llava/llava.cpp b/examples/llava/llava.cpp index edfd6c072..d2ce65df6 100644 --- a/examples/llava/llava.cpp +++ b/examples/llava/llava.cpp @@ -116,17 +116,17 @@ LLAMA_API struct llava_image_embed * llava_image_embed_make_with_bytes(struct cl return result; } -static bool load_file_to_bytes(const char* path, unsigned char** bytesOut, long *sizeOut) +static bool load_file_to_bytes(const char* path, unsigned char** bytesOut, long *sizeOut) { - auto file = fopen(path, "rb"); + auto file = fopen(path, "rb"); if (file == NULL) { fprintf(stderr, "%s: can't read file %s\n", __func__, path); return false; } - fseek(file, 0, SEEK_END); - auto fileSize = ftell(file); - fseek(file, 0, SEEK_SET); + fseek(file, 0, SEEK_END); + auto fileSize = ftell(file); + fseek(file, 0, SEEK_SET); auto buffer = (unsigned char *)malloc(fileSize); // Allocate memory to hold the file data if (buffer == NULL) {