mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-23 20:40:58 +00:00
WIP (hit a clang bug causing an incorrect compiler error)
This commit is contained in:
@@ -144,8 +144,8 @@ configure_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/config.h"
|
||||
)
|
||||
|
||||
add_subdirectory(../deps "${CMAKE_CURRENT_BINARY_DIR}/common_deps")
|
||||
add_subdirectory(deps)
|
||||
add_subdirectory(../gpt4all-backend gpt4all-backend)
|
||||
add_subdirectory(../gpt4all-backend-old llmodel)
|
||||
|
||||
if (GPT4ALL_TEST)
|
||||
@@ -458,7 +458,7 @@ else()
|
||||
target_link_libraries(chat PRIVATE pdfium)
|
||||
endif()
|
||||
target_link_libraries(chat
|
||||
PRIVATE llmodel nlohmann_json::nlohmann_json SingleApplication fmt::fmt duckx::duckx QXlsx)
|
||||
PRIVATE gpt4all-backend llmodel nlohmann_json::nlohmann_json SingleApplication fmt::fmt duckx::duckx QXlsx)
|
||||
target_include_directories(chat PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/deps/minja/include)
|
||||
|
||||
if (APPLE)
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include <utility>
|
||||
|
||||
import fmt;
|
||||
import gpt4all.backend.formatters;
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include "database.h"
|
||||
#include "tool.h"
|
||||
#include "toolcallparser.h"
|
||||
#include "utils.h" // IWYU pragma: keep
|
||||
#include "xlsxtomd.h"
|
||||
|
||||
#include <QAbstractListModel>
|
||||
@@ -41,6 +40,7 @@
|
||||
#include <vector>
|
||||
|
||||
import fmt;
|
||||
import gpt4all.backend.formatters;
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
namespace ranges = std::ranges;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#include "database.h"
|
||||
|
||||
#include "mysettings.h"
|
||||
#include "utils.h" // IWYU pragma: keep
|
||||
|
||||
#include <duckx/duckx.hpp>
|
||||
#include <usearch/index.hpp>
|
||||
@@ -42,6 +41,7 @@
|
||||
#endif
|
||||
|
||||
import fmt;
|
||||
import gpt4all.backend.formatters;
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
namespace ranges = std::ranges;
|
||||
|
@@ -7,8 +7,6 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
import fmt;
|
||||
|
||||
namespace views = std::views;
|
||||
using json = nlohmann::ordered_json;
|
||||
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include "chatmodel.h"
|
||||
#include "modellist.h"
|
||||
#include "mysettings.h"
|
||||
#include "utils.h" // IWYU pragma: keep
|
||||
|
||||
#include <gpt4all-backend/llmodel.h>
|
||||
|
||||
@@ -49,6 +48,7 @@
|
||||
#include <vector>
|
||||
|
||||
import fmt;
|
||||
import gpt4all.backend.formatters;
|
||||
|
||||
using namespace std::string_literals;
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
@@ -1,42 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QJsonValue>
|
||||
#include <QLatin1StringView> // IWYU pragma: keep
|
||||
#include <QString>
|
||||
#include <QStringView>
|
||||
#include <QUtf8StringView>
|
||||
#include <QVariant>
|
||||
|
||||
#include <initializer_list>
|
||||
#include <string_view>
|
||||
#include <utility> // IWYU pragma: keep
|
||||
|
||||
import fmt;
|
||||
|
||||
// IWYU pragma: no_forward_declare QJsonValue
|
||||
class QJsonObject;
|
||||
|
||||
|
||||
// fmtlib formatters for QString and QVariant
|
||||
|
||||
#define MAKE_FORMATTER(type, conversion) \
|
||||
template <> \
|
||||
struct fmt::formatter<type, char>: fmt::formatter<std::string_view, char> { \
|
||||
template <typename FmtContext> \
|
||||
FmtContext::iterator format(const type &value, FmtContext &ctx) const \
|
||||
{ \
|
||||
auto valueUtf8 = (conversion); \
|
||||
std::string_view view(valueUtf8.cbegin(), valueUtf8.cend()); \
|
||||
return formatter<std::string_view, char>::format(view, ctx); \
|
||||
} \
|
||||
}
|
||||
|
||||
MAKE_FORMATTER(QUtf8StringView, value );
|
||||
MAKE_FORMATTER(QStringView, value.toUtf8() );
|
||||
MAKE_FORMATTER(QString, value.toUtf8() );
|
||||
MAKE_FORMATTER(QVariant, value.toString().toUtf8());
|
||||
|
||||
// alternative to QJsonObject's initializer_list constructor that accepts Latin-1 strings
|
||||
QJsonObject makeJsonObject(std::initializer_list<std::pair<QLatin1StringView, QJsonValue>> args);
|
||||
|
||||
|
Reference in New Issue
Block a user