From bc0598565a3f3bdb25622305d3af1c836b1c998a Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Thu, 20 Feb 2025 13:09:23 -0500 Subject: [PATCH] WIP --- .gitmodules | 2 +- deps/fmt | 2 +- gpt4all-backend-old/deps/llama.cpp-mainline | 2 +- gpt4all-backend-test/src/main.cpp | 4 ++-- gpt4all-chat/CMakeLists.txt | 5 +++++ gpt4all-chat/src/chatllm.cpp | 3 ++- gpt4all-chat/src/chatmodel.h | 4 ++-- gpt4all-chat/src/database.cpp | 3 ++- gpt4all-chat/src/jinja_helpers.cpp | 4 ++-- gpt4all-chat/src/server.cpp | 4 ++-- gpt4all-chat/src/utils.h | 5 ++--- 11 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.gitmodules b/.gitmodules index 77721feb..94d9aa6c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,7 +10,7 @@ url = https://github.com/nomic-ai/SingleApplication.git [submodule "gpt4all-chat/deps/fmt"] path = deps/fmt - url = https://github.com/fmtlib/fmt.git + url = https://github.com/nomic-ai/fmt.git [submodule "gpt4all-chat/deps/DuckX"] path = gpt4all-chat/deps/DuckX url = https://github.com/nomic-ai/DuckX.git diff --git a/deps/fmt b/deps/fmt index 0c9fce2f..55a1103e 160000 --- a/deps/fmt +++ b/deps/fmt @@ -1 +1 @@ -Subproject commit 0c9fce2ffefecfdce794e1859584e25877b7b592 +Subproject commit 55a1103e5feb5200c004d9331863014b7835ca52 diff --git a/gpt4all-backend-old/deps/llama.cpp-mainline b/gpt4all-backend-old/deps/llama.cpp-mainline index 11f734c3..4a59c79e 160000 --- a/gpt4all-backend-old/deps/llama.cpp-mainline +++ b/gpt4all-backend-old/deps/llama.cpp-mainline @@ -1 +1 @@ -Subproject commit 11f734c3b0334dbae4823b4a7467764e447fc6d6 +Subproject commit 4a59c79eae0847bf618c2d1b25c35616c1f6a838 diff --git a/gpt4all-backend-test/src/main.cpp b/gpt4all-backend-test/src/main.cpp index 6aabf475..641e47b7 100644 --- a/gpt4all-backend-test/src/main.cpp +++ b/gpt4all-backend-test/src/main.cpp @@ -1,9 +1,9 @@ +#include + import fmt; import gpt4all.backend.main; import gpt4all.test.config; -#include - using gpt4all::backend::LLMProvider; diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt index e6e00606..274e0c1a 100644 --- a/gpt4all-chat/CMakeLists.txt +++ b/gpt4all-chat/CMakeLists.txt @@ -386,6 +386,7 @@ qt_add_translations(chat ) set_target_properties(chat PROPERTIES + CXX_SCAN_FOR_MODULES ON WIN32_EXECUTABLE TRUE ) @@ -614,3 +615,7 @@ else() cpack_ifw_add_repository("GPT4AllRepository" URL "https://gpt4all.io/installer_repos/mac/repository") endif() endif() +set_source_files_properties( + "chat_autogen/mocs_compilation.cpp" + PROPERTIES CXX_SCAN_FOR_MODULES ON +) diff --git a/gpt4all-chat/src/chatllm.cpp b/gpt4all-chat/src/chatllm.cpp index c962fcd2..8bccc3b4 100644 --- a/gpt4all-chat/src/chatllm.cpp +++ b/gpt4all-chat/src/chatllm.cpp @@ -11,7 +11,6 @@ #include "toolmodel.h" #include "toolcallparser.h" -#include #include #include @@ -54,6 +53,8 @@ #include #include +import fmt; + using namespace Qt::Literals::StringLiterals; using namespace ToolEnums; namespace ranges = std::ranges; diff --git a/gpt4all-chat/src/chatmodel.h b/gpt4all-chat/src/chatmodel.h index 27e6063a..59dee27f 100644 --- a/gpt4all-chat/src/chatmodel.h +++ b/gpt4all-chat/src/chatmodel.h @@ -7,8 +7,6 @@ #include "utils.h" #include "xlsxtomd.h" -#include - #include #include #include @@ -33,6 +31,8 @@ #include #include +import fmt; + using namespace Qt::Literals::StringLiterals; namespace ranges = std::ranges; namespace views = std::views; diff --git a/gpt4all-chat/src/database.cpp b/gpt4all-chat/src/database.cpp index 6f9fa5e7..6f10178c 100644 --- a/gpt4all-chat/src/database.cpp +++ b/gpt4all-chat/src/database.cpp @@ -4,7 +4,6 @@ #include "utils.h" #include -#include #include #include @@ -39,6 +38,8 @@ # include #endif +import fmt; + using namespace Qt::Literals::StringLiterals; namespace ranges = std::ranges; namespace us = unum::usearch; diff --git a/gpt4all-chat/src/jinja_helpers.cpp b/gpt4all-chat/src/jinja_helpers.cpp index 9ae11f7d..6743b948 100644 --- a/gpt4all-chat/src/jinja_helpers.cpp +++ b/gpt4all-chat/src/jinja_helpers.cpp @@ -2,8 +2,6 @@ #include "utils.h" -#include - #include #include @@ -12,6 +10,8 @@ #include #include +import fmt; + namespace views = std::views; using json = nlohmann::ordered_json; diff --git a/gpt4all-chat/src/server.cpp b/gpt4all-chat/src/server.cpp index 20a3fa7a..96e593e8 100644 --- a/gpt4all-chat/src/server.cpp +++ b/gpt4all-chat/src/server.cpp @@ -6,8 +6,6 @@ #include "mysettings.h" #include "utils.h" -#include - #include #include #include @@ -42,6 +40,8 @@ # include #endif +import fmt; + using namespace std::string_literals; using namespace Qt::Literals::StringLiterals; diff --git a/gpt4all-chat/src/utils.h b/gpt4all-chat/src/utils.h index ac67e892..2febcc92 100644 --- a/gpt4all-chat/src/utils.h +++ b/gpt4all-chat/src/utils.h @@ -1,8 +1,5 @@ #pragma once -#include -#include - #include #include #include @@ -15,6 +12,8 @@ #include #include +import fmt; + class QJsonObject;