drop vicuna

This commit is contained in:
Jörg Thalheim 2024-12-04 19:21:40 +01:00
parent beca6482c0
commit f8d6bf707b
3 changed files with 0 additions and 53 deletions

View File

@ -782,7 +782,6 @@ in {
aliases = [
"jack.r"
"stable-confusion.r"
"vicuna.r"
];
tinc.pubkey = ''
-----BEGIN RSA PUBLIC KEY-----

View File

@ -253,24 +253,6 @@ let
};
};
vicuna = {
pattern = "^!vicuna (.*)$";
activate = "match";
arguments = [1];
timeoutSec = 1337;
command = {
filename = pkgs.writeDash "vicuna" ''
set -efu
mkdir -p ${stateDir}/vicuna
export CONTEXT=${stateDir}/vicuna/"$_msgtarget".context
${pkgs.vicuna-chat}/bin/vicuna-chat "$@" |
echo "$_from: $(cat)" |
fold -s -w 426
'';
};
};
locationsLib = pkgs.writeText "locations.sh" ''
ENDPOINT=http://c.r/poi.json
get_locations() {
@ -431,7 +413,6 @@ let
hooks.sed
interrogate
say
vicuna
(generators.command_hook {
inherit (commands) dance random-emoji nixos-version;
tell = {

View File

@ -1,33 +0,0 @@
{ pkgs, ... }:
pkgs.writers.writeDashBin "vicuna-chat" ''
set -efu
export PATH=${with pkgs; lib.makeBinPath [
coreutils
curl
jq
]}
CONTEXT=''${CONTEXT:-$(date -Id)}
PROMPT=$*
if ! test -e "$CONTEXT"; then
echo -n 'null' > "$CONTEXT"
fi
add_to_context() {
jq -rc --argjson message "$1" '. + [$message]' "$CONTEXT" > "$CONTEXT.tmp"
mv "$CONTEXT.tmp" "$CONTEXT"
}
add_to_context "{\"role\": \"user\", \"content\": \"$PROMPT\"}"
response=$(
jq -nc --slurpfile context "$CONTEXT" '{
model: "vicuna-13b-v1.5-16k",
messages: $context[0],
}' |
curl -Ss http://vicuna.r/v1/chat/completions -H 'Content-Type: application/json' -d @-
)
add_to_context "$(jq -rcn --argjson response "$response" '$response.choices[0].message')"
jq -rcn --argjson response "$response" '$response.choices[0].message.content'
''