drop vicuna
This commit is contained in:
parent
beca6482c0
commit
f8d6bf707b
@ -782,7 +782,6 @@ in {
|
|||||||
aliases = [
|
aliases = [
|
||||||
"jack.r"
|
"jack.r"
|
||||||
"stable-confusion.r"
|
"stable-confusion.r"
|
||||||
"vicuna.r"
|
|
||||||
];
|
];
|
||||||
tinc.pubkey = ''
|
tinc.pubkey = ''
|
||||||
-----BEGIN RSA PUBLIC KEY-----
|
-----BEGIN RSA PUBLIC KEY-----
|
||||||
|
@ -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" ''
|
locationsLib = pkgs.writeText "locations.sh" ''
|
||||||
ENDPOINT=http://c.r/poi.json
|
ENDPOINT=http://c.r/poi.json
|
||||||
get_locations() {
|
get_locations() {
|
||||||
@ -431,7 +413,6 @@ let
|
|||||||
hooks.sed
|
hooks.sed
|
||||||
interrogate
|
interrogate
|
||||||
say
|
say
|
||||||
vicuna
|
|
||||||
(generators.command_hook {
|
(generators.command_hook {
|
||||||
inherit (commands) dance random-emoji nixos-version;
|
inherit (commands) dance random-emoji nixos-version;
|
||||||
tell = {
|
tell = {
|
||||||
|
@ -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'
|
|
||||||
''
|
|
Loading…
Reference in New Issue
Block a user