mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-19 00:02:12 -04:00
Compare commits
No commits in common. "e86c63750de248ae2b277145fc252da11e53bc87" and "0f046cf905067219b4030800beee778c98eae007" have entirely different histories.
e86c63750d
...
0f046cf905
@ -134,8 +134,6 @@ add_library(llmodel
|
|||||||
llmodel_c.h llmodel_c.cpp
|
llmodel_c.h llmodel_c.cpp
|
||||||
dlhandle.h
|
dlhandle.h
|
||||||
)
|
)
|
||||||
target_link_libraries(llmodel PRIVATE ggml-mainline-default)
|
|
||||||
target_compile_definitions(llmodel PRIVATE GGML_BUILD_VARIANT="default")
|
|
||||||
target_compile_definitions(llmodel PRIVATE LIB_FILE_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
target_compile_definitions(llmodel PRIVATE LIB_FILE_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
|
|
||||||
set_target_properties(llmodel PROPERTIES
|
set_target_properties(llmodel PROPERTIES
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 0631ea363c14335969095976bbe17bf20503bc6d
|
Subproject commit 703ef9c1252aff4f6c4e1fdc60fffe6ab9def377
|
@ -185,21 +185,6 @@ if (LLAMA_KOMPUTE)
|
|||||||
string(REPLACE "." "_" HEADER_FILE_DEFINE "${HEADER_FILE_DEFINE}")
|
string(REPLACE "." "_" HEADER_FILE_DEFINE "${HEADER_FILE_DEFINE}")
|
||||||
set(OUTPUT_HEADER_FILE "${HEADER_FILE}")
|
set(OUTPUT_HEADER_FILE "${HEADER_FILE}")
|
||||||
message(STATUS "${HEADER_FILE} generating ${HEADER_FILE_DEFINE}")
|
message(STATUS "${HEADER_FILE} generating ${HEADER_FILE_DEFINE}")
|
||||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "/*THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT*/" > ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo \"\#ifndef ${HEADER_FILE_DEFINE}\" >> ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo \"\#define ${HEADER_FILE_DEFINE}\" >> ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "namespace kp {" >> ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "namespace shader_data {" >> ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/xxd -i ${spv_file} >> ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "}}" >> ${OUTPUT_HEADER_FILE}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo \"\#endif // define ${HEADER_FILE_DEFINE}\" >> ${OUTPUT_HEADER_FILE}
|
|
||||||
DEPENDS ${spv_file} xxd
|
|
||||||
COMMENT "Converting to hpp: ${FILE_NAME} ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/xxd"
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${OUTPUT_HEADER_FILE}
|
OUTPUT ${OUTPUT_HEADER_FILE}
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "/*THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT*/" > ${OUTPUT_HEADER_FILE}
|
COMMAND ${CMAKE_COMMAND} -E echo "/*THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT*/" > ${OUTPUT_HEADER_FILE}
|
||||||
@ -213,7 +198,6 @@ if (LLAMA_KOMPUTE)
|
|||||||
DEPENDS ${spv_file} xxd
|
DEPENDS ${spv_file} xxd
|
||||||
COMMENT "Converting to hpp: ${FILE_NAME} ${CMAKE_BINARY_DIR}/bin/xxd"
|
COMMENT "Converting to hpp: ${FILE_NAME} ${CMAKE_BINARY_DIR}/bin/xxd"
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
@ -101,7 +101,6 @@ public:
|
|||||||
virtual bool initializeGPUDevice(int /*device*/) { return false; }
|
virtual bool initializeGPUDevice(int /*device*/) { return false; }
|
||||||
virtual bool hasGPUDevice() { return false; }
|
virtual bool hasGPUDevice() { return false; }
|
||||||
virtual bool usingGPUDevice() { return false; }
|
virtual bool usingGPUDevice() { return false; }
|
||||||
static std::vector<GPUDevice> availableGPUDevices();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// These are pure virtual because subclasses need to implement as the default implementation of
|
// These are pure virtual because subclasses need to implement as the default implementation of
|
||||||
|
@ -4,10 +4,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#ifdef GGML_USE_KOMPUTE
|
|
||||||
#include "ggml-vulkan.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void LLModel::recalculateContext(PromptContext &promptCtx, std::function<bool(bool)> recalculate) {
|
void LLModel::recalculateContext(PromptContext &promptCtx, std::function<bool(bool)> recalculate) {
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
promptCtx.n_past = 0;
|
promptCtx.n_past = 0;
|
||||||
@ -178,26 +174,3 @@ std::vector<float> LLModel::embedding(const std::string &/*text*/)
|
|||||||
}
|
}
|
||||||
return std::vector<float>();
|
return std::vector<float>();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<LLModel::GPUDevice> LLModel::availableGPUDevices()
|
|
||||||
{
|
|
||||||
#if defined(GGML_USE_KOMPUTE)
|
|
||||||
std::vector<ggml_vk_device> vkDevices = ggml_vk_available_devices(0);
|
|
||||||
|
|
||||||
std::vector<LLModel::GPUDevice> devices;
|
|
||||||
for(const auto& vkDevice : vkDevices) {
|
|
||||||
LLModel::GPUDevice device;
|
|
||||||
device.index = vkDevice.index;
|
|
||||||
device.type = vkDevice.type;
|
|
||||||
device.heapSize = vkDevice.heapSize;
|
|
||||||
device.name = vkDevice.name;
|
|
||||||
device.vendor = vkDevice.vendor;
|
|
||||||
|
|
||||||
devices.push_back(device);
|
|
||||||
}
|
|
||||||
|
|
||||||
return devices;
|
|
||||||
#else
|
|
||||||
return std::vector<LLModel::GPUDevice>();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
@ -18,7 +18,7 @@ endif()
|
|||||||
|
|
||||||
set(APP_VERSION_MAJOR 2)
|
set(APP_VERSION_MAJOR 2)
|
||||||
set(APP_VERSION_MINOR 4)
|
set(APP_VERSION_MINOR 4)
|
||||||
set(APP_VERSION_PATCH 20)
|
set(APP_VERSION_PATCH 17)
|
||||||
set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}")
|
set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}")
|
||||||
|
|
||||||
# Include the binary directory for the generated header file
|
# Include the binary directory for the generated header file
|
||||||
|
@ -263,6 +263,12 @@ bool ChatLLM::loadModel(const ModelInfo &modelInfo)
|
|||||||
if (m_llModelInfo.model) {
|
if (m_llModelInfo.model) {
|
||||||
// Update the settings that a model is being loaded and update the device list
|
// Update the settings that a model is being loaded and update the device list
|
||||||
MySettings::globalInstance()->setAttemptModelLoad(filePath);
|
MySettings::globalInstance()->setAttemptModelLoad(filePath);
|
||||||
|
std::vector<LLModel::GPUDevice> devices = m_llModelInfo.model->availableGPUDevices(0);
|
||||||
|
QVector<QString> deviceList{ "Auto" };
|
||||||
|
for (LLModel::GPUDevice &d : devices)
|
||||||
|
deviceList << QString::fromStdString(d.name);
|
||||||
|
deviceList << "CPU";
|
||||||
|
MySettings::globalInstance()->setDeviceList(deviceList);
|
||||||
|
|
||||||
// Pick the best match for the device
|
// Pick the best match for the device
|
||||||
QString actualDevice = m_llModelInfo.model->implementation().buildVariant() == "metal" ? "Metal" : "CPU";
|
QString actualDevice = m_llModelInfo.model->implementation().buildVariant() == "metal" ? "Metal" : "CPU";
|
||||||
|
@ -506,29 +506,6 @@
|
|||||||
"
|
"
|
||||||
* Adam Treat (Nomic AI)
|
* Adam Treat (Nomic AI)
|
||||||
* Aaron Miller (Nomic AI)
|
* Aaron Miller (Nomic AI)
|
||||||
"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "2.4.18",
|
|
||||||
"notes":
|
|
||||||
"
|
|
||||||
* Bugfix for devices to show up in the settings combobox on application start and not just on model load
|
|
||||||
* Send information on requested device and actual device on model load to help assess which model/gpu/os combos are working
|
|
||||||
",
|
|
||||||
"contributors":
|
|
||||||
"
|
|
||||||
* Adam Treat (Nomic AI)
|
|
||||||
"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "2.4.19",
|
|
||||||
"notes":
|
|
||||||
"
|
|
||||||
* Fix a crasher on systems with corrupted vulkan drivers or corrupted vulkan dlls
|
|
||||||
",
|
|
||||||
"contributors":
|
|
||||||
"
|
|
||||||
* Adam Treat (Nomic AI)
|
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "mysettings.h"
|
#include "mysettings.h"
|
||||||
#include "modellist.h"
|
#include "modellist.h"
|
||||||
#include "../gpt4all-backend/llmodel.h"
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -64,13 +63,6 @@ MySettings::MySettings()
|
|||||||
: QObject{nullptr}
|
: QObject{nullptr}
|
||||||
{
|
{
|
||||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
|
|
||||||
std::vector<LLModel::GPUDevice> devices = LLModel::availableGPUDevices();
|
|
||||||
QVector<QString> deviceList{ "Auto" };
|
|
||||||
for (LLModel::GPUDevice &d : devices)
|
|
||||||
deviceList << QString::fromStdString(d.name);
|
|
||||||
deviceList << "CPU";
|
|
||||||
setDeviceList(deviceList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE QVector<QString> MySettings::deviceList() const
|
Q_INVOKABLE QVector<QString> MySettings::deviceList() const
|
||||||
|
@ -393,8 +393,6 @@ void Network::sendMixpanelEvent(const QString &ev, const QVector<KeyValue> &valu
|
|||||||
properties.insert("name", QCoreApplication::applicationName() + " v"
|
properties.insert("name", QCoreApplication::applicationName() + " v"
|
||||||
+ QCoreApplication::applicationVersion());
|
+ QCoreApplication::applicationVersion());
|
||||||
properties.insert("model", ChatListModel::globalInstance()->currentChat()->modelInfo().filename());
|
properties.insert("model", ChatListModel::globalInstance()->currentChat()->modelInfo().filename());
|
||||||
properties.insert("requestedDevice", MySettings::globalInstance()->device());
|
|
||||||
properties.insert("actualDevice", ChatListModel::globalInstance()->currentChat()->device());
|
|
||||||
|
|
||||||
// Some additional startup information
|
// Some additional startup information
|
||||||
if (ev == "startup") {
|
if (ev == "startup") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user