build settings
This commit is contained in:
parent
9612d12fbf
commit
6518f9c482
4 changed files with 12 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -34,6 +34,7 @@ models/*
|
||||||
/embedding
|
/embedding
|
||||||
/benchmark-matmult
|
/benchmark-matmult
|
||||||
/vdot
|
/vdot
|
||||||
|
/server
|
||||||
/Pipfile
|
/Pipfile
|
||||||
/libllama.so
|
/libllama.so
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -3,6 +3,8 @@ BUILD_TARGETS = main quantize quantize-stats perplexity embedding vdot
|
||||||
|
|
||||||
ifdef LLAMA_BUILD_SERVER
|
ifdef LLAMA_BUILD_SERVER
|
||||||
BUILD_TARGETS += server
|
BUILD_TARGETS += server
|
||||||
|
LLAMA_SERVER_VERBOSE ?= 1
|
||||||
|
server: CXXFLAGS += -DSERVER_VERBOSE=$(LLAMA_SERVER_VERBOSE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
default: $(BUILD_TARGETS)
|
default: $(BUILD_TARGETS)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(TARGET server)
|
set(TARGET server)
|
||||||
|
option(LLAMA_SERVER_VERBOSE "Build verbose logging option for Server" ON)
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
add_executable(${TARGET} server.cpp json.hpp httplib.h)
|
add_executable(${TARGET} server.cpp json.hpp httplib.h)
|
||||||
target_compile_definitions(${TARGET} PRIVATE
|
target_compile_definitions(${TARGET} PRIVATE
|
||||||
|
@ -8,6 +9,8 @@ target_compile_definitions(${TARGET} PRIVATE
|
||||||
$<$<CONFIG:Debug>:
|
$<$<CONFIG:Debug>:
|
||||||
CPPHTTPLIB_NO_EXCEPTIONS=1
|
CPPHTTPLIB_NO_EXCEPTIONS=1
|
||||||
>
|
>
|
||||||
|
|
||||||
|
SERVER_VERBOSE=$<BOOL:${LLAMA_SERVER_VERBOSE}>
|
||||||
)
|
)
|
||||||
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
|
||||||
target_compile_features(${TARGET} PRIVATE cxx_std_11)
|
target_compile_features(${TARGET} PRIVATE cxx_std_11)
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
#include "httplib.h"
|
#include "httplib.h"
|
||||||
#include "json.hpp"
|
#include "json.hpp"
|
||||||
|
|
||||||
|
#ifndef SERVER_VERBOSE
|
||||||
|
#define SERVER_VERBOSE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace httplib;
|
using namespace httplib;
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
|
@ -553,7 +557,7 @@ void server_params_parse(int argc, char ** argv, server_params & sparams,
|
||||||
params.lora_base = argv[i];
|
params.lora_base = argv[i];
|
||||||
} else if (arg == "-v" || arg == "--verbose") {
|
} else if (arg == "-v" || arg == "--verbose") {
|
||||||
sparams.verbose = true;
|
sparams.verbose = true;
|
||||||
#ifndef SERVER_VERBOSE
|
#if SERVER_VERBOSE != 1
|
||||||
LOG_WARNING("server.cpp is not built with verbose logging.", {});
|
LOG_WARNING("server.cpp is not built with verbose logging.", {});
|
||||||
#endif
|
#endif
|
||||||
} else if (arg == "--mlock") {
|
} else if (arg == "--mlock") {
|
||||||
|
@ -743,7 +747,7 @@ int main(int argc, char ** argv) {
|
||||||
|
|
||||||
server_params_parse(argc, argv, sparams, params);
|
server_params_parse(argc, argv, sparams, params);
|
||||||
|
|
||||||
#ifdef SERVER_VERBOSE
|
#if SERVER_VERBOSE == 1
|
||||||
server_verbose = sparams.verbose;
|
server_verbose = sparams.verbose;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue