From 1a1400cd91a01a82e4d213d6bca1ba85628db50a Mon Sep 17 00:00:00 2001 From: tikikun Date: Wed, 3 Jan 2024 14:37:26 +0700 Subject: [PATCH 1/4] remove redundant build command --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 264644eca..e695bcb51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ add_executable(${PROJECT_NAME} main.cc) # # and comment out the following lines find_package(Drogon CONFIG REQUIRED) -target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon common llama llava +target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon common llava ${CMAKE_THREAD_LIBS_INIT}) # ############################################################################## From 733540926d7d53d5470162e39ce1159c331b774d Mon Sep 17 00:00:00 2001 From: tikikun Date: Wed, 3 Jan 2024 14:37:39 +0700 Subject: [PATCH 2/4] refactor new way to include properly --- controllers/llamaCPP.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/controllers/llamaCPP.h b/controllers/llamaCPP.h index e4152ed85..589899a97 100644 --- a/controllers/llamaCPP.h +++ b/controllers/llamaCPP.h @@ -14,8 +14,7 @@ // External #include "common.h" #include "llama.h" - -#include "../../llama.cpp/examples/llava/clip.h" +#include "clip.h" #include "stb_image.h" From 0c06aa57bc66c50930bee44d22f9488dace720e5 Mon Sep 17 00:00:00 2001 From: tikikun Date: Wed, 3 Jan 2024 14:39:07 +0700 Subject: [PATCH 3/4] format the code --- controllers/llamaCPP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/llamaCPP.h b/controllers/llamaCPP.h index 589899a97..83632d68c 100644 --- a/controllers/llamaCPP.h +++ b/controllers/llamaCPP.h @@ -12,9 +12,9 @@ #include // External +#include "clip.h" #include "common.h" #include "llama.h" -#include "clip.h" #include "stb_image.h" From be6ef923e2006ca5862af62c343ec0b96a87ced7 Mon Sep 17 00:00:00 2001 From: tikikun Date: Wed, 3 Jan 2024 16:43:34 +0700 Subject: [PATCH 4/4] bug: change back to busy waiting to avoid issue on background task --- controllers/llamaCPP.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/llamaCPP.h b/controllers/llamaCPP.h index 83632d68c..c1017c757 100644 --- a/controllers/llamaCPP.h +++ b/controllers/llamaCPP.h @@ -1537,8 +1537,9 @@ struct llama_server_context { "cache\n"); kv_cache_clear(); } - std::unique_lock lock(mutex_tasks); - condition_tasks.wait(lock, [&] { return !queue_tasks.empty(); }); + // TODO: Need to implement queueing using CV for better performance + // std::unique_lock lock(mutex_tasks); + // condition_tasks.wait(lock, [&] { return !queue_tasks.empty(); }); } for (llama_client_slot &slot : slots) {