Skip to content

Commit 24c3126

Browse files
committed
Add demo script with clear instructions
1 parent 4ced2bc commit 24c3126

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

run_demo.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "╔════════════════════════════════════════════════════════════╗"
5+
echo "║ Tinker Evaluation-Driven Fine-Tuning Demo ║"
6+
echo "╚════════════════════════════════════════════════════════════╝"
7+
echo ""
8+
9+
if [ -z "$TINKER_API_KEY" ]; then
10+
echo "❌ Error: TINKER_API_KEY environment variable not set"
11+
echo ""
12+
echo "Please set your Tinker API key:"
13+
echo " export TINKER_API_KEY=sk-your-key-here"
14+
echo ""
15+
exit 1
16+
fi
17+
18+
echo "✓ Tinker API key found"
19+
echo ""
20+
21+
if [ ! -d ".venv" ]; then
22+
echo "📦 Creating virtual environment..."
23+
python3 -m venv .venv
24+
fi
25+
26+
echo "📦 Installing dependencies..."
27+
source .venv/bin/activate
28+
pip install -q -r requirements.txt
29+
30+
echo "✓ Dependencies installed"
31+
echo ""
32+
33+
echo "🚀 Starting evaluation-driven training loop..."
34+
echo " - Base model: meta-llama/Llama-3.1-8B-Instruct"
35+
echo " - Training data: 20 examples (demo_data.jsonl)"
36+
echo " - Max rounds: 3"
37+
echo " - Eval threshold: 0.75"
38+
echo " - Initial LR: 0.0003 (decays by 0.6x per round)"
39+
echo ""
40+
41+
python trainer_with_eval.py --config demo_config.json
42+
43+
echo ""
44+
echo "✅ Demo complete!"
45+
echo ""
46+
echo "What happened:"
47+
echo " 1. Loaded 20 training examples"
48+
echo " 2. Fine-tuned model with LoRA on Tinker infrastructure"
49+
echo " 3. Evaluated model on QA tasks"
50+
echo " 4. If score < 0.75: adjusted LR and started Round 2"
51+
echo " 5. Repeated until threshold met or max rounds reached"
52+
echo ""
53+
echo "Next steps:"
54+
echo " - Review checkpoints saved in Tinker"
55+
echo " - Enable EvalOps integration to track all runs"
56+
echo " - Replace simple_eval.py with real Inspect AI tasks"

0 commit comments

Comments
 (0)