Add gpt-2 guiding to annna. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 25728ff0be3295e3b016a0963b03afccd27742ab DIR parent e2274ec5f948466a23937ee00b3ee21290d55c6e HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Mon, 21 Aug 2023 15:38:29 +0200 Add gpt-2 guiding to annna. Diffstat: M annna-message-common | 12 ++++++++++++ M ggml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) --- DIR diff --git a/annna-message-common b/annna-message-common @@ -553,6 +553,18 @@ case "${text}" in fi } & ;; +"${ircuser}, how do I "*) + { + gptprompt="$(printf "%s\n" "${text}" \ + | sed 's,.*how do I \(.*\),\1,' \ + | tr -d '?')" + gpturi="$(ggml "how do I ${gptprompt}" | bitreich-paste)" + if [ -n "${gpturi}" ]; + then + annna-say -s "${server}" -c "${channel}" "${user}, try this: ${gpturi}" + fi + } & + ;; "${ircuser}, weather at "*) { weatherplace="$(printf "%s\n" "${text}" \ DIR diff --git a/ggml b/ggml @@ -5,7 +5,7 @@ ggmlbin="./build/bin/gpt-2" ggmlmodel="models/gpt-2-1558M/ggml-model.bin" cd $ggmlbase -$ggmlbin -m $ggmlmodel -p "$@" \ +$ggmlbin -m $ggmlmodel -p "$@" 2>/dev/null \ | tail -n +19 \ | head -n -6