Editorconfig

This commit is contained in:
M. Yusuf Sarıgöz 2023-11-05 15:33:16 +03:00
parent c6b88446e9
commit 32bf7bf61f
4 changed files with 8 additions and 8 deletions

View file

@ -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) # 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. # are not used. This changes that.
if (WIN32) if (WIN32)
set_target_properties(llama PROPERTIES set_target_properties(llama PROPERTIES
LINK_FLAGS "/WHOLEARCHIVE" LINK_FLAGS "/WHOLEARCHIVE"
) )

View file

@ -680,7 +680,7 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) {
return new_clip; return new_clip;
} }
clip_image_u8 * make_clip_image_u8() { clip_image_u8 * make_clip_image_u8() {
auto img = new clip_image_u8(); auto img = new clip_image_u8();
return img; return img;
} }

View file

@ -165,7 +165,7 @@ inline bool prompt_contains_image(const std::string& prompt) {
} }
// replaces the base64 image tag in the prompt with `replacement` // 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; size_t img_base64_str_start, img_base64_str_end;
find_image_tag_in_prompt(prompt, 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) { if (img_base64_str_start == std::string::npos || img_base64_str_end == std::string::npos) {

View file

@ -116,17 +116,17 @@ LLAMA_API struct llava_image_embed * llava_image_embed_make_with_bytes(struct cl
return result; 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) { if (file == NULL) {
fprintf(stderr, "%s: can't read file %s\n", __func__, path); fprintf(stderr, "%s: can't read file %s\n", __func__, path);
return false; return false;
} }
fseek(file, 0, SEEK_END); fseek(file, 0, SEEK_END);
auto fileSize = ftell(file); auto fileSize = ftell(file);
fseek(file, 0, SEEK_SET); fseek(file, 0, SEEK_SET);
auto buffer = (unsigned char *)malloc(fileSize); // Allocate memory to hold the file data auto buffer = (unsigned char *)malloc(fileSize); // Allocate memory to hold the file data
if (buffer == NULL) { if (buffer == NULL) {