Move the llmodel C API to new top-level directory and version it.

This commit is contained in:
Adam Treat 2023-05-10 11:46:40 -04:00
parent 658248205a
commit 8e7b96bd92
18 changed files with 15 additions and 7 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "llama.cpp"] [submodule "llama.cpp"]
path = gpt4all-chat/llmodel/llama.cpp path = gpt4all-backend/llama.cpp
url = https://github.com/manyoso/llama.cpp.git url = https://github.com/manyoso/llama.cpp.git

View File

@ -15,7 +15,11 @@ endif()
# Include the binary directory for the generated header file # Include the binary directory for the generated header file
include_directories("${CMAKE_CURRENT_BINARY_DIR}") include_directories("${CMAKE_CURRENT_BINARY_DIR}")
project(llmodel VERSION ${APP_VERSION} LANGUAGES CXX C) set(LLMODEL_VERSION_MAJOR 0)
set(LLMODEL_VERSION_MINOR 1)
set(LLMODEL_VERSION_PATCH 0)
set(LLMODEL_VERSION "${LLMODEL_VERSION_MAJOR}.${LLMODEL_VERSION_MINOR}.${LLMODEL_VERSION_PATCH}")
project(llmodel VERSION ${LLMODEL_VERSION} LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -43,5 +47,9 @@ add_library(llmodel
target_link_libraries(llmodel target_link_libraries(llmodel
PRIVATE llama) PRIVATE llama)
set_target_properties(llmodel PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
set(COMPONENT_NAME_MAIN ${PROJECT_NAME}) set(COMPONENT_NAME_MAIN ${PROJECT_NAME})
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)

View File

@ -52,7 +52,7 @@ get_filename_component(Qt6_ROOT_DIR "${Qt6_ROOT_DIR}/.." ABSOLUTE)
message(STATUS "qmake binary: ${QMAKE_EXECUTABLE}") message(STATUS "qmake binary: ${QMAKE_EXECUTABLE}")
message(STATUS "Qt 6 root directory: ${Qt6_ROOT_DIR}") message(STATUS "Qt 6 root directory: ${Qt6_ROOT_DIR}")
add_subdirectory(llmodel) add_subdirectory(../gpt4all-backend llmodel)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

View File

@ -2,9 +2,9 @@
#include "chat.h" #include "chat.h"
#include "download.h" #include "download.h"
#include "network.h" #include "network.h"
#include "llmodel/gptj.h" #include "../gpt4all-backend/gptj.h"
#include "llmodel/llamamodel.h" #include "../gpt4all-backend/llamamodel.h"
#include "llmodel/mpt.h" #include "../gpt4all-backend/mpt.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDir> #include <QDir>

View File

@ -4,7 +4,7 @@
#include <QObject> #include <QObject>
#include <QThread> #include <QThread>
#include "llmodel/llmodel.h" #include "../gpt4all-backend/llmodel.h"
class Chat; class Chat;
class ChatLLM : public QObject class ChatLLM : public QObject