update and some fixes
This commit is contained in:
@@ -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