Compare commits
3 Commits
f321cea6eb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0d28fb516 | ||
|
|
39f714394b | ||
|
|
7e1b424adb |
5
external/CMakeLists.txt
vendored
5
external/CMakeLists.txt
vendored
@@ -51,9 +51,12 @@ endif()
|
||||
#endif()
|
||||
|
||||
if (NOT TARGET httplib::httplib)
|
||||
# fails on android
|
||||
set(HTTPLIB_USE_ZSTD_IF_AVAILABLE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <solanaceae/plugin/solana_plugin_v1.h>
|
||||
|
||||
#include <solanaceae/util/config_model.hpp>
|
||||
#include <solanaceae/contact/contact_store_i.hpp>
|
||||
#include <solanaceae/llama-cpp-web/text_completion_interface.hpp>
|
||||
#include <solanaceae/rpbot/rpbot.hpp>
|
||||
#include <solanaceae/message3/message_command_dispatcher.hpp>
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
|
||||
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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user