diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 533c675..8685fd0 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -53,7 +53,7 @@ endif() if (NOT TARGET httplib::httplib) FetchContent_Declare(httplib GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git - GIT_TAG v0.19.0 + GIT_TAG v0.22.0 EXCLUDE_FROM_ALL ) FetchContent_MakeAvailable(httplib) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 344cb07..6cc387b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,11 +20,11 @@ target_link_libraries(solanaceae_llama-cpp-web PUBLIC ######################################## -add_executable(test1 EXCLUDE_FROM_ALL +add_executable(solanaceae_llama-cpp-web_test1 EXCLUDE_FROM_ALL test1.cpp ) -target_link_libraries(test1 PUBLIC +target_link_libraries(solanaceae_llama-cpp-web_test1 PUBLIC solanaceae_llama-cpp-web ) diff --git a/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp b/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp index 1a94505..30fbfc5 100644 --- a/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp +++ b/src/solanaceae/llama-cpp-web/llama_cpp_web_impl.cpp @@ -33,7 +33,10 @@ bool LlamaCppWeb::isGood(void) { res.error() != httplib::Error::Success || res->status != 200 || res->body.empty() || - res->get_header_value("Content-Type") != "application/json" + ( + res->get_header_value("Content-Type") != "application/json" && + res->get_header_value("Content-Type") != "application/json; charset=utf-8" + ) ) { return false; } diff --git a/src/test1.cpp b/src/test1.cpp index dd72335..ee60b9f 100644 --- a/src/test1.cpp +++ b/src/test1.cpp @@ -5,13 +5,11 @@ #include #include -#include #include -#include -#include int main(void) { SimpleConfigModel scm; + scm.set("LlamaCppWeb", "server", std::string_view{"localhost:8081"}); LlamaCppWeb lcw{scm}; if (!lcw.isGood()) { @@ -30,7 +28,7 @@ int main(void) { {"top_p", 1.0}, // disable {"n_predict", 16}, {"stop", {".", "\n"}}, - {"gramar", ""} + {"grammar", ""} }) << "\n";