-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·45 lines (34 loc) · 1.26 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·45 lines (34 loc) · 1.26 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
43
44
45
#!/usr/bin/env bash
#
# Cross-platform setup for Linux / macOS (Windows users: run setup.bat).
# Creates a venv, installs pinned dependencies, and processes your Telegram
# export into a training-ready ShareGPT dataset.
#
set -euo pipefail
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$BASE_DIR"
PYTHON="${PYTHON:-python3}"
echo "[1/4] Creating virtual environment (venv)..."
"$PYTHON" -m venv venv
echo "[2/4] Installing dependencies (this can take a while)..."
./venv/bin/python -m pip install --upgrade pip
./venv/bin/python -m pip install -r requirements.txt
echo "[3/4] Preparing .env..."
if [ ! -f .env ]; then
cp example.env .env
echo " Created .env from example.env — edit it to enable optional LLM features."
fi
echo "[4/4] Processing Telegram export (data/result.json -> data/chat_sharegpt.json)..."
mkdir -p data
if [ ! -f data/result.json ]; then
echo " data/result.json not found. Place your Telegram export there, then re-run." >&2
exit 1
fi
./venv/bin/python -m ingest --source telegram
cat <<'EOF'
All steps completed successfully.
Next, activate the environment and launch training:
source venv/bin/activate
llamafactory-cli train configs/train_lora.yaml
See README.md for export/merge and inference instructions.
EOF