From f8d6bf707bceff35c97fc73dd3c38c0d8b38bf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 4 Dec 2024 19:21:40 +0100 Subject: drop vicuna --- krebs/5pkgs/simple/vicuna-chat/default.nix | 33 ------------------------------ 1 file changed, 33 deletions(-) delete mode 100644 krebs/5pkgs/simple/vicuna-chat/default.nix (limited to 'krebs/5pkgs/simple') diff --git a/krebs/5pkgs/simple/vicuna-chat/default.nix b/krebs/5pkgs/simple/vicuna-chat/default.nix deleted file mode 100644 index db15899d6..000000000 --- a/krebs/5pkgs/simple/vicuna-chat/default.nix +++ /dev/null @@ -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' -'' -- cgit v1.2.3