Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ if(DEBUG)
add_compile_definitions(ALLOW_ALL_CORS)
endif()

if(NOT DEFINED NITRO_VERSION)
set(NITRO_VERSION "default_version")
endif()

add_compile_definitions(NITRO_VERSION="${NITRO_VERSION}")

add_subdirectory(llama.cpp)
add_executable(${PROJECT_NAME} main.cc)

Expand Down Expand Up @@ -71,11 +77,10 @@ aux_source_directory(controllers CTL_SRC)
# aux_source_directory(filters FILTER_SRC) aux_source_directory(plugins
# PLUGIN_SRC) aux_source_directory(models MODEL_SRC)

#drogon_create_views(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/views
# ${CMAKE_CURRENT_BINARY_DIR})
# use the following line to create views with namespaces.
# drogon_create_views(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/views
# ${CMAKE_CURRENT_BINARY_DIR} TRUE)
# ${CMAKE_CURRENT_BINARY_DIR}) use the following line to create views with
# namespaces. drogon_create_views(${PROJECT_NAME}
# ${CMAKE_CURRENT_SOURCE_DIR}/views ${CMAKE_CURRENT_BINARY_DIR} TRUE)

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
# ${CMAKE_CURRENT_SOURCE_DIR}/models)
Expand Down
6 changes: 5 additions & 1 deletion main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <drogon/HttpAppFramework.h>
#include <drogon/drogon.h>
#include <iostream>
#include <algorithm>

#if defined(__APPLE__) && defined(__MACH__)
#include <libgen.h> // for dirname()
Expand Down Expand Up @@ -41,6 +40,11 @@ int main(int argc, char *argv[]) {
int logical_cores = std::thread::hardware_concurrency();
int drogon_thread_num = std::max(thread_num, logical_cores);
nitro_utils::nitro_logo();
#ifdef NITRO_VERSION
LOG_INFO << "Nitro version: " << NITRO_VERSION;
#else
LOG_INFO << "Nitro version: undefined";
#endif
LOG_INFO << "Server started, listening at: " << host << ":" << port;
LOG_INFO << "Please load your model";
drogon::app().addListener(host, port);
Expand Down