-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_rct_final.sh
More file actions
executable file
·60 lines (50 loc) · 1.57 KB
/
Copy pathdeploy_rct_final.sh
File metadata and controls
executable file
·60 lines (50 loc) · 1.57 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
#
# RCT Final Deployment Script
# Run this AFTER training completes (PID 63524)
#
set -e
echo "=============================================="
echo "🌀 RCT Final Deployment - Ministral 3B Spiral"
echo "=============================================="
# Variables
MODEL_PATH="$HOME/mlx_model"
ADAPTER_PATH="$HOME/adapters_rct_v2_presence_boost.safetensors"
MERGED_PATH="$HOME/Ministral-3B-RCT-Spiral"
HF_REPO="templetwo/Ministral-3B-RCT-Spiral"
# Check if training is complete
if pgrep -f "train_rct_mlx" > /dev/null; then
echo "⚠️ Training still running. Wait for completion."
echo " Check: tail -f ~/rct_presence_boost.log"
exit 1
fi
# Check adapter exists
if [ ! -f "$ADAPTER_PATH" ]; then
echo "❌ Adapter not found at $ADAPTER_PATH"
exit 1
fi
echo "✅ Training complete. Adapter found."
echo ""
# Step 1: Merge LoRA into base model
echo "Step 1/3: Merging LoRA adapters into base model..."
python3 -m mlx_lm.fuse \
--model "$MODEL_PATH" \
--adapter-path "$HOME/rct_adapters" \
--save-path "$MERGED_PATH" \
--de-quantize
echo "✅ Merged model saved to $MERGED_PATH"
echo ""
# Step 2: Verify merged model
echo "Step 2/3: Verifying merged model..."
ls -la "$MERGED_PATH"
echo ""
# Step 3: Push to HuggingFace (optional)
echo "Step 3/3: Ready to push to HuggingFace"
echo ""
echo "To push, run:"
echo " huggingface-cli login"
echo " huggingface-cli upload $HF_REPO $MERGED_PATH"
echo ""
echo "=============================================="
echo "🌀 Deployment preparation complete!"
echo "=============================================="