gpt4all: 2.8.0 -> 3.2.1

This commit is contained in:
Simon Gardling 2024-08-27 12:49:21 -04:00
parent 8b16862469
commit 31bd29314c
No known key found for this signature in database
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 65 additions and 3 deletions

View File

@ -0,0 +1,50 @@
commit 1e8fdf3f90fd142c5ddd63e44ca1e5c172dbfb7f
Author: Simon Gardling <titaniumtown@proton.me>
Date: Tue Aug 27 12:45:14 2024 -0400
use locally downloaded embeddings
index 27f3f5d9..9e25528a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,6 +90,7 @@ elseif (APPLE)
endif()
# Embedding model
+#[[
set(LOCAL_EMBEDDING_MODEL "nomic-embed-text-v1.5.f16.gguf")
set(LOCAL_EMBEDDING_MODEL_MD5 "a5401e7f7e46ed9fcaed5b60a281d547")
set(LOCAL_EMBEDDING_MODEL_PATH "${CMAKE_BINARY_DIR}/resources/${LOCAL_EMBEDDING_MODEL}")
@@ -104,6 +105,7 @@
if (APPLE)
list(APPEND CHAT_EXE_RESOURCES "${LOCAL_EMBEDDING_MODEL_PATH}")
endif()
+]]
qt_add_executable(chat
main.cpp
@@ -383,11 +385,13 @@
endif()
endif()
+#[[
if (NOT APPLE)
install(FILES "${CMAKE_BINARY_DIR}/resources/${LOCAL_EMBEDDING_MODEL}"
DESTINATION resources
COMPONENT ${COMPONENT_NAME_MAIN})
endif()
+]]
set(CPACK_GENERATOR "IFW")
set(CPACK_VERBATIM_VARIABLES YES)
--- a/embllm.cpp
+++ b/embllm.cpp
@@ -84,7 +84,7 @@ bool EmbeddingLLMWorker::loadModel()
QString filePath = embPathFmt.arg(QCoreApplication::applicationDirPath(), LOCAL_EMBEDDING_MODEL);
if (!QFileInfo::exists(filePath)) {
- qWarning() << "embllm WARNING: Local embedding model not found";
+ qWarning() << "embllm WARNING: Local embedding model not found: " << filePath;
return false;
}

View File

@ -2,6 +2,7 @@
, config
, stdenv
, fetchFromGitHub
, fetchurl
, cmake
, qt6
, fmt
@ -14,16 +15,25 @@
stdenv.mkDerivation (finalAttrs: {
pname = "gpt4all";
version = "2.8.0";
version = "3.2.1";
src = fetchFromGitHub {
fetchSubmodules = true;
hash = "sha256-aSz37+1K26Xizf4cpV45a2DnSsl959VQok/ppFRk/hs=";
hash = "sha256-h6hcqafTjQsqVlpnqVeohh38A67VSGrW3WrCErjaKIQ=";
owner = "nomic-ai";
repo = "gpt4all";
rev = "v${finalAttrs.version}";
};
embed_model = fetchurl {
url = "https://gpt4all.io/models/gguf/nomic-embed-text-v1.5.f16.gguf";
sha256 = "f7af6f66802f4df86eda10fe9bbcfc75c39562bed48ef6ace719a251cf1c2fdb";
};
patches = [
./embedding-local.patch
];
sourceRoot = "${finalAttrs.src.name}/gpt4all-chat";
nativeBuildInputs = [
@ -41,6 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
qt6.qthttpserver
qt6.qtwebengine
qt6.qt5compat
qt6.qttools
shaderc
vulkan-headers
wayland
@ -64,8 +75,9 @@ stdenv.mkDerivation (finalAttrs: {
rm -rf $out/include
rm -rf $out/lib/*.a
mv $out/bin/chat $out/bin/${finalAttrs.meta.mainProgram}
install -D ${finalAttrs.embed_model} $out/resources/nomic-embed-text-v1.5.f16.gguf
install -m 444 -D $src/gpt4all-chat/flatpak-manifest/io.gpt4all.gpt4all.desktop $out/share/applications/io.gpt4all.gpt4all.desktop
install -m 444 -D $src/gpt4all-chat/icons/logo.svg $out/share/icons/hicolor/scalable/apps/io.gpt4all.gpt4all.svg
install -m 444 -D $src/gpt4all-chat/icons/nomic_logo.svg $out/share/icons/hicolor/scalable/apps/io.gpt4all.gpt4all.svg
substituteInPlace $out/share/applications/io.gpt4all.gpt4all.desktop \
--replace-fail 'Exec=chat' 'Exec=${finalAttrs.meta.mainProgram}'
'';