Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-mb committed May 24, 2024
1 parent 629420e commit f7b3c48
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1348,3 +1348,4 @@ if (LLAMA_BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(pocs)
endif()
add_subdirectory(../ext_server ext_server) # ollama
1 change: 1 addition & 0 deletions examples/minicpmv/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// I'll gradually clean and extend it
// Note: Even when using identical normalized image inputs (see normalize_image_u8_to_f32()) we have a significant difference in resulting embeddings compared to pytorch
#include "clip.h"
#include "common.h"
#include "log.h"
#include "ggml.h"
#include "ggml-alloc.h"
Expand Down
25 changes: 16 additions & 9 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15380,15 +15380,22 @@ struct llama_model * llama_load_model_from_file(
model->rpc_servers.push_back(servers);
}
int status = llama_model_load(path_model, *model, params);
GGML_ASSERT(status <= 0);
if (status < 0) {
if (status == -1) {
LLAMA_LOG_ERROR("%s: failed to load model\n", __func__);
} else if (status == -2) {
LLAMA_LOG_INFO("%s: cancelled model load\n", __func__);
}
delete model;
return nullptr;
try {
int status = llama_model_load(path_model, *model, params);
GGML_ASSERT(status <= 0);
if (status < 0) {
if (status == -1) {
LLAMA_LOG_ERROR("%s: failed to load model\n", __func__);
} else if (status == -2) {
LLAMA_LOG_INFO("%s: cancelled model load\n", __func__);
}
delete model;
return nullptr;
}
} catch (...) {
LLAMA_LOG_ERROR("%s: exception loading model\n", __func__);
delete model;
throw;
}

return model;
Expand Down

0 comments on commit f7b3c48

Please sign in to comment.