iandennismiller commited on
Commit
6a8d17c
1 Parent(s): 17a696b

new llama-prompt script

Browse files
Files changed (2) hide show
  1. bin/llama-prompt.sh +36 -0
  2. install.sh +1 -0
bin/llama-prompt.sh ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # if conf does not exist, create it
4
+ if [ ! -f "$HOME/.config/llama/llama-prompt.conf" ]; then
5
+ mkdir -p "$HOME/.config/llama"
6
+ cat <<EOF > "$HOME/.config/llama/llama-prompt.conf"
7
+ LLAMA_MODEL_NAME=$HOME/.ai/models/llama/teknium/OpenHermes-2.5-Mistral-7B/openhermes-2.5-mistral-7b-f16.gguf
8
+ LLAMA_CONTEXT_SIZE=8192
9
+ EOF
10
+ fi
11
+
12
+ source "$HOME/.config/llama/llama-prompt.conf"
13
+
14
+ # if an extra argument is provided, use it for LLAMA_MODEL_NAME
15
+ if [ -n "$2" ]; then
16
+ LLAMA_MODEL_NAME="$2"
17
+ fi
18
+
19
+ # if an extra argument is provided, use it for LLAMA_CONTEXT_SIZE
20
+ if [ -n "$3" ]; then
21
+ LLAMA_CONTEXT_SIZE="$3"
22
+ fi
23
+
24
+ # if no arguments are provided, print an error message and exit
25
+ if [ -z "$1" ]; then
26
+ echo "Usage: llama-prompt.sh <prompt> [model] [context_size]"
27
+ exit 1
28
+ fi
29
+
30
+ llama \
31
+ --file "$1" \
32
+ --model "$LLAMA_MODEL_NAME" \
33
+ --ctx-size "$LLAMA_CONTEXT_SIZE" \
34
+ --mirostat 2 \
35
+ --repeat-last-n 64 \
36
+ --log-disable 2> /dev/null | fmt -w 80
install.sh CHANGED
@@ -14,6 +14,7 @@ install -C -v ./bin/llama.sh ~/.local/bin
14
  install -C -v ./bin/llama-menu.sh ~/.local/bin
15
  install -C -v ./bin/llama-server.sh ~/.local/bin
16
  install -C -v ./bin/llava-describe.sh ~/.local/bin
 
17
 
18
  if [ -n "$(ls ./share/characters)" ]; then
19
  install -C -v ./share/characters/* ~/.local/share/llama/characters
 
14
  install -C -v ./bin/llama-menu.sh ~/.local/bin
15
  install -C -v ./bin/llama-server.sh ~/.local/bin
16
  install -C -v ./bin/llava-describe.sh ~/.local/bin
17
+ install -C -v ./bin/llama-prompt.sh ~/.local/bin
18
 
19
  if [ -n "$(ls ./share/characters)" ]; then
20
  install -C -v ./share/characters/* ~/.local/share/llama/characters