gpt4all: bleeding edge

This commit is contained in:
Simon Gardling 2024-09-19 10:21:06 -04:00
parent d4fef2c256
commit 6786cc9092
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
4 changed files with 163 additions and 78 deletions

View File

@ -316,11 +316,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1726650330, "lastModified": 1726724509,
"narHash": "sha256-UbHzmaOQ18O/kCizipU70N0UQVFIfv8AiFKXw07oZ9Y=", "narHash": "sha256-sVeAM1tgVi52S1e29fFBTPUAFSzgQwgLon3CrztXGm8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "abb448608a56a60075468e90d8acec2a7cb689b1", "rev": "10d5e0ecc32984c1bf1a9a46586be3451c42fd94",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -332,11 +332,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726668270, "lastModified": 1726751368,
"narHash": "sha256-+N9ASvTufNJ6VAkkvSgXMtd+0RrzjXF83AMyamQlX9Y=", "narHash": "sha256-UaLaS+LAGslTFnQOZs16Y90ybdA6rXoznqu2HvO5ykU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "50470da36ef2c4448b23285257de4be40acd5c7c", "rev": "fa09c7cca3aa8685ca69198b4510d54ef1fa7f73",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -33,11 +33,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726574742, "lastModified": 1726674526,
"narHash": "sha256-eWANP6s59C3tAMrExHwL7Sap51XUz/0f1cfGysXGnxA=", "narHash": "sha256-eKAUZRSynuVmNxCmyj4X3TrpI7uOggP+WNd4r1wnhSM=",
"owner": "orhun", "owner": "orhun",
"repo": "binsider", "repo": "binsider",
"rev": "31797519bd6ff5df0a4d9d530a25411597ca2915", "rev": "fd2f7d2b46b34916009040d78fd6b170728d1338",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -201,11 +201,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726669401, "lastModified": 1726701516,
"narHash": "sha256-HuyEQH0VI3m5DlCNbDafhBaOOBZTYmuTiikqr/gbNO0=", "narHash": "sha256-0xr+2k66e5g+SPXgHceaFZJlqq9kkAbahHE3vdYVZ3I=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f86e59bbb9ea7447f3aff57d67444cd1113e646", "rev": "db8da26fb9e7a031f2882c14d86e705b853e6104",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -0,0 +1,53 @@
commit 425b33877c819dd88f3692aae37452c767371f6b
Author: Simon Gardling <titaniumtown@proton.me>
Date: Thu Sep 19 10:00:39 2024 -0400
use locally downloaded embeddings
diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt
index 900307ae..802fc31a 100644
--- a//CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,6 +120,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}")
@@ -134,6 +135,7 @@ message(STATUS "Embedding model downloaded to ${LOCAL_EMBEDDING_MODEL_PATH}")
if (APPLE)
list(APPEND CHAT_EXE_RESOURCES "${LOCAL_EMBEDDING_MODEL_PATH}")
endif()
+]]
set(QAPPLICATION_CLASS QGuiApplication)
add_subdirectory(deps/SingleApplication)
@@ -348,11 +350,13 @@ if (LLMODEL_CUDA)
endif()
endif()
+#[[
if (NOT APPLE)
install(FILES "${LOCAL_EMBEDDING_MODEL_PATH}"
DESTINATION resources
COMPONENT ${COMPONENT_NAME_MAIN})
endif()
+]]
set(CPACK_GENERATOR "IFW")
set(CPACK_VERBATIM_VARIABLES YES)
diff --git a/gpt4all-chat/src/embllm.cpp b/gpt4all-chat/src/embllm.cpp
index 81b1e9e1..e3266cc7 100644
--- a/src/embllm.cpp
+++ b/src/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

@ -17,96 +17,128 @@
"factorio-alpha" "factorio-alpha"
]; ];
home.packages = with pkgs; [ home.packages =
#calculator let
gnome-calculator #stolen from: https://stackoverflow.com/a/42398526
optimizeWithFlags =
pkg: flags:
pkgs.lib.overrideDerivation pkg (
old:
let
newflags = pkgs.lib.foldl' (acc: x: "${acc} ${x}") "" flags;
oldflags = if (pkgs.lib.hasAttr "NIX_CFLAGS_COMPILE" old) then "${old.NIX_CFLAGS_COMPILE}" else "";
in
{
NIX_CFLAGS_COMPILE = "${oldflags} ${newflags}";
}
);
in
with pkgs;
[
#calculator
gnome-calculator
#productivity stuff #productivity stuff
libreoffice libreoffice
hunspell # spellcheck hunspell # spellcheck
hunspellDicts.en_US # spellcheck dictionary hunspellDicts.en_US # spellcheck dictionary
#video and audio downloading #video and audio downloading
parabolic parabolic
#soulseek client #soulseek client
nicotine-plus nicotine-plus
#dark web browsing deep web browsing #dark web browsing deep web browsing
tor-browser tor-browser
#audio editing #audio editing
audacity audacity
#fonts #fonts
noto-fonts noto-fonts
noto-fonts-emoji noto-fonts-emoji
liberation_ttf liberation_ttf
nerdfonts nerdfonts
jetbrains-mono jetbrains-mono
#for ebook reading #for ebook reading
foliate foliate
#audio mixer (pavucontrol but for pipewire) #audio mixer (pavucontrol but for pipewire)
pwvucontrol pwvucontrol
#minecraft launcher #minecraft launcher
prismlauncher prismlauncher
mpv mpv
mumble mumble
system76-keyboard-configurator system76-keyboard-configurator
mission-center mission-center
#jellyfin #jellyfin
finamp # music player finamp # music player
delfin # jellyfin client delfin # jellyfin client
signal-desktop signal-desktop
#accounting #accounting
gnucash gnucash
imagemagick imagemagick
inkscape inkscape
nomacs nomacs
nautilus nautilus
darktable lrcget
lrcget #openstreetmap contributing
josm
#openstreetmap contributing easyeffects
josm gparted
easyeffects #small nicities
gparted wl-clipboard # wl-copy & wl-paste
libnotify # notifications library
xdg-utils # xdg utils
gpt4all gnome-disk-utility
#small nicities puddletag
wl-clipboard # wl-copy & wl-paste
libnotify # notifications library
xdg-utils # xdg utils
gnome-disk-utility inputs.zen-browser.packages."${pkgs.system}".specific
puddletag (factorio.override (
let
data = import ./secrets/factorio.nix;
in
{
username = data.username;
token = data.token;
}
))
inputs.zen-browser.packages."${pkgs.system}".specific (optimizeWithFlags
(pkgs.gpt4all.overrideAttrs {
(factorio.override ( src = pkgs.fetchFromGitHub {
let fetchSubmodules = true;
data = import ./secrets/factorio.nix; owner = "nomic-ai";
in repo = "gpt4all";
{ rev = "HEAD";
username = data.username; sha256 = "S8yWNjylDaXbOviUd7Nhk7mfT0jjBsZq7XAGX38USpc=";
token = data.token; };
} patches = [ ./gpt4all-HEAD-embeddings-model.patch ];
)) })
]; [
"-Ofast"
"-march=native"
"-mtune=native"
"-fno-finite-math-only" # https://github.com/ggerganov/llama.cpp/pull/7154#issuecomment-2143844461
]
)
];
# make chromium-based stuff use wayland # make chromium-based stuff use wayland
home.file.".config/chromium-flags.conf".text = "--ozone-platform-hint=auto"; home.file.".config/chromium-flags.conf".text = "--ozone-platform-hint=auto";