gpt4all: properly handle newlines in system prompt

This commit is contained in:
Simon Gardling 2024-09-20 17:31:17 -04:00
parent e3e3036c06
commit c0f8f7617b
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
4 changed files with 16 additions and 16 deletions

View File

@ -332,11 +332,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1726844355,
"narHash": "sha256-sbvo+lzHkAdQp7lum7/IbJtUMLJQSoERsQI2Zoytg7I=",
"lastModified": 1726856061,
"narHash": "sha256-aHq3GDX5dNDuNy37TKTY/BD3+2vakPP8W+kNt7p0PZk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ff5752aab38a462024e8fce1475e37dcbd0e7526",
"rev": "a0d059de3645c1b598d258675aaaa9ffdb0039b1",
"type": "github"
},
"original": {

View File

@ -111,17 +111,15 @@
security.pam.services.swaylock = { };
system.activationScripts = {
"secureboot-keys".text =
let
secureboot_path = "/etc/secureboot";
in
''
#!/bin/sh
rm -fr ${secureboot_path}
rm -fr ${secureboot_path} || true
mkdir -p ${secureboot_path}
${pkgs.gnutar}/bin/tar xf /etc/nixos/secrets/secureboot.tar -C ${secureboot_path}
'';
};
}

View File

@ -153,11 +153,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1726595793,
"narHash": "sha256-3TL/g2mCfe88ehUtoGh82HF9lKRgCpFHSIXli9yB+Sk=",
"lastModified": 1726854506,
"narHash": "sha256-GiNELLwy79Gr7IhlDeydbAxOHMIy9RzqsYzQzslXo+Q=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "318b1ef1b47bc30dddd0b14b0a8a2093039e275a",
"rev": "0f18e6a6a591267c8b9e9a7b142f8073a4a91e61",
"type": "github"
},
"original": {
@ -201,11 +201,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1726844355,
"narHash": "sha256-sbvo+lzHkAdQp7lum7/IbJtUMLJQSoERsQI2Zoytg7I=",
"lastModified": 1726858900,
"narHash": "sha256-4EI5BtmTC1KW/TEiqLtwnvHOdtdDiek7C55dnYwiv/E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ff5752aab38a462024e8fce1475e37dcbd0e7526",
"rev": "01e6f3a3316f32d8d792b96e263bab2ed14225b4",
"type": "github"
},
"original": {
@ -229,11 +229,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1726447378,
"narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=",
"lastModified": 1726688310,
"narHash": "sha256-Xc9lEtentPCEtxc/F1e6jIZsd4MPDYv4Kugl9WtXlz0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1",
"rev": "dbebdd67a6006bb145d98c8debf9140ac7e651d0",
"type": "github"
},
"original": {

View File

@ -105,7 +105,9 @@ in
maxLength=${model.gen_length}
promptBatchSize=256
promptTemplate=<|im_start|>user\n%1<|im_end|>\n<|im_start|>assistant\n
systemPrompt="<|im_start|>system\n${system_prompt}<|im_end|>
systemPrompt="<|im_start|>system\n${
builtins.replaceStrings [ "\n" ] [ "\\n" ] system_prompt
}<|im_end|>
\n"
'') models
));