-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.sh
More file actions
executable file
·42 lines (37 loc) · 1.03 KB
/
chat.sh
File metadata and controls
executable file
·42 lines (37 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# CLI Chat - Interactive terminal chat with the model
# Usage: ./chat.sh
# Press Ctrl+C to exit
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/config.sh"
# Check if llama.cpp is built
if [ ! -f "${LLAMA_CPP_DIR}/build/bin/llama-cli" ]; then
echo "ERROR: llama.cpp not built. Run ./setup.sh first."
exit 1
fi
# Check if model exists
if [ ! -f "$MODEL_PATH" ]; then
echo "ERROR: Model not found: $MODEL_PATH"
echo ""
echo "Download it first:"
echo " ./download-model.sh $ACTIVE_MODEL"
exit 1
fi
# Interactive chat
echo "=== Coding Assistant Chat ==="
echo "Model: $ACTIVE_MODEL"
echo "Threads: $N_THREADS"
echo "Context: $CONTEXT_SIZE"
echo ""
echo "Type your questions or code requests."
echo "Press Ctrl+C to exit."
echo ""
"${LLAMA_CPP_DIR}/build/bin/llama-cli" \
--model "$MODEL_PATH" \
--threads "$N_THREADS" \
--ctx-size "$CONTEXT_SIZE" \
--temp "$TEMPERATURE" \
--top-p "$TOP_P" \
--repeat-penalty "$REPEAT_PENALTY" \
--log-disable