-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchat.sh
More file actions
executable file
·30 lines (26 loc) · 837 Bytes
/
chat.sh
File metadata and controls
executable file
·30 lines (26 loc) · 837 Bytes
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
#!/bin/bash
# Launch interactive chat with BitNet model
# Usage: ./chat.sh [model_dir] [threads]
# ./chat.sh # default 2B model, 4 threads
# ./chat.sh models/BitNet-b1.58-2B-4T 8 # specify model and threads
MODEL_DIR="${1:-models/BitNet-b1.58-2B-4T}"
THREADS="${2:-4}"
MODEL_FILE="$MODEL_DIR/ggml-model-i2_s.gguf"
if [ ! -f "$MODEL_FILE" ]; then
echo "Model not found: $MODEL_FILE"
echo "Available models:"
find models -name "*.gguf" 2>/dev/null
exit 1
fi
export SDKROOT=$(xcrun --show-sdk-path)
export LIBRARY_PATH="$SDKROOT/usr/lib:${LIBRARY_PATH:-}"
exec ./build/bin/llama-cli \
-m "$MODEL_FILE" \
-t "$THREADS" \
-n 512 \
-c 4096 \
--temp 0.7 \
--top-p 0.9 \
--repeat-penalty 1.1 \
-cnv \
-p "You are a helpful, concise assistant."