mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-09-19 23:35:41 +00:00
Get the backend as well as the client building/working with msvc.
This commit is contained in:
parent
63f57635d8
commit
474c5387f9
@ -1,4 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
option(BUILD_UNIVERSAL "Build a Universal binary on macOS" ON)
|
option(BUILD_UNIVERSAL "Build a Universal binary on macOS" ON)
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
option(BUILD_UNIVERSAL "Build a Universal binary on macOS" OFF)
|
option(BUILD_UNIVERSAL "Build a Universal binary on macOS" OFF)
|
||||||
if(BUILD_UNIVERSAL)
|
if(BUILD_UNIVERSAL)
|
||||||
|
@ -370,7 +370,7 @@ void Download::parseModelsJsonFile(const QByteArray &jsonData)
|
|||||||
|
|
||||||
QString modelFilename = obj["filename"].toString();
|
QString modelFilename = obj["filename"].toString();
|
||||||
QString modelFilesize = obj["filesize"].toString();
|
QString modelFilesize = obj["filesize"].toString();
|
||||||
QString requires = obj["requires"].toString();
|
QString requiresVersion = obj["requires"].toString();
|
||||||
QByteArray modelMd5sum = obj["md5sum"].toString().toLatin1().constData();
|
QByteArray modelMd5sum = obj["md5sum"].toString().toLatin1().constData();
|
||||||
bool isDefault = obj.contains("isDefault") && obj["isDefault"] == QString("true");
|
bool isDefault = obj.contains("isDefault") && obj["isDefault"] == QString("true");
|
||||||
bool bestGPTJ = obj.contains("bestGPTJ") && obj["bestGPTJ"] == QString("true");
|
bool bestGPTJ = obj.contains("bestGPTJ") && obj["bestGPTJ"] == QString("true");
|
||||||
@ -378,9 +378,9 @@ void Download::parseModelsJsonFile(const QByteArray &jsonData)
|
|||||||
bool bestMPT = obj.contains("bestMPT") && obj["bestMPT"] == QString("true");
|
bool bestMPT = obj.contains("bestMPT") && obj["bestMPT"] == QString("true");
|
||||||
QString description = obj["description"].toString();
|
QString description = obj["description"].toString();
|
||||||
|
|
||||||
if (!requires.isEmpty()
|
if (!requiresVersion.isEmpty()
|
||||||
&& requires != currentVersion
|
&& requiresVersion != currentVersion
|
||||||
&& compareVersions(requires, currentVersion)) {
|
&& compareVersions(requiresVersion, currentVersion)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ void Download::parseModelsJsonFile(const QByteArray &jsonData)
|
|||||||
modelInfo.bestLlama = bestLlama;
|
modelInfo.bestLlama = bestLlama;
|
||||||
modelInfo.bestMPT = bestMPT;
|
modelInfo.bestMPT = bestMPT;
|
||||||
modelInfo.description = description;
|
modelInfo.description = description;
|
||||||
modelInfo.requires = requires;
|
modelInfo.requiresVersion = requiresVersion;
|
||||||
m_modelMap.insert(modelInfo.filename, modelInfo);
|
m_modelMap.insert(modelInfo.filename, modelInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ void Download::parseModelsJsonFile(const QByteArray &jsonData)
|
|||||||
modelInfo.isChatGPT = true;
|
modelInfo.isChatGPT = true;
|
||||||
modelInfo.filename = "chatgpt-gpt-3.5-turbo";
|
modelInfo.filename = "chatgpt-gpt-3.5-turbo";
|
||||||
modelInfo.description = tr("OpenAI's ChatGPT model gpt-3.5-turbo. ") + chatGPTDesc;
|
modelInfo.description = tr("OpenAI's ChatGPT model gpt-3.5-turbo. ") + chatGPTDesc;
|
||||||
modelInfo.requires = "2.4.2";
|
modelInfo.requiresVersion = "2.4.2";
|
||||||
QString filePath = downloadLocalModelsPath() + modelInfo.filename + ".txt";
|
QString filePath = downloadLocalModelsPath() + modelInfo.filename + ".txt";
|
||||||
QFileInfo info(filePath);
|
QFileInfo info(filePath);
|
||||||
modelInfo.installed = info.exists();
|
modelInfo.installed = info.exists();
|
||||||
@ -435,7 +435,7 @@ void Download::parseModelsJsonFile(const QByteArray &jsonData)
|
|||||||
modelInfo.isChatGPT = true;
|
modelInfo.isChatGPT = true;
|
||||||
modelInfo.filename = "chatgpt-gpt-4";
|
modelInfo.filename = "chatgpt-gpt-4";
|
||||||
modelInfo.description = tr("OpenAI's ChatGPT model gpt-4. ") + chatGPTDesc;
|
modelInfo.description = tr("OpenAI's ChatGPT model gpt-4. ") + chatGPTDesc;
|
||||||
modelInfo.requires = "2.4.2";
|
modelInfo.requiresVersion = "2.4.2";
|
||||||
QString filePath = downloadLocalModelsPath() + modelInfo.filename + ".txt";
|
QString filePath = downloadLocalModelsPath() + modelInfo.filename + ".txt";
|
||||||
QFileInfo info(filePath);
|
QFileInfo info(filePath);
|
||||||
modelInfo.installed = info.exists();
|
modelInfo.installed = info.exists();
|
||||||
|
@ -22,7 +22,7 @@ struct ModelInfo {
|
|||||||
Q_PROPERTY(bool bestMPT MEMBER bestMPT)
|
Q_PROPERTY(bool bestMPT MEMBER bestMPT)
|
||||||
Q_PROPERTY(bool isChatGPT MEMBER isChatGPT)
|
Q_PROPERTY(bool isChatGPT MEMBER isChatGPT)
|
||||||
Q_PROPERTY(QString description MEMBER description)
|
Q_PROPERTY(QString description MEMBER description)
|
||||||
Q_PROPERTY(QString requires MEMBER requires)
|
Q_PROPERTY(QString requiresVersion MEMBER requiresVersion)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString filename;
|
QString filename;
|
||||||
@ -36,7 +36,7 @@ public:
|
|||||||
bool bestMPT = false;
|
bool bestMPT = false;
|
||||||
bool isChatGPT = false;
|
bool isChatGPT = false;
|
||||||
QString description;
|
QString description;
|
||||||
QString requires;
|
QString requiresVersion;
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(ModelInfo)
|
Q_DECLARE_METATYPE(ModelInfo)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#if __GNUC__
|
||||||
static bool avx = __builtin_cpu_supports("avx");
|
static bool avx = __builtin_cpu_supports("avx");
|
||||||
static bool avx2 = __builtin_cpu_supports("avx2");
|
static bool avx2 = __builtin_cpu_supports("avx2");
|
||||||
static bool fma = __builtin_cpu_supports("fma");
|
static bool fma = __builtin_cpu_supports("fma");
|
||||||
@ -25,5 +26,6 @@ int main(int argc, char *argv[])
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fprintf(stderr, "\" version of gpt4all.\n");
|
fprintf(stderr, "\" version of gpt4all.\n");
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user