Prithvik-1 commited on
Commit
c6dbcac
·
verified ·
1 Parent(s): 170941e

Upload start_training_chat_format.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. start_training_chat_format.sh +60 -0
start_training_chat_format.sh ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # Start CodeLlama fine-tuning with chat format dataset
3
+
4
+ set -e
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ cd "$SCRIPT_DIR"
8
+
9
+ # Activate virtual environment
10
+ source /venv/main/bin/activate
11
+
12
+ echo "======================================================================"
13
+ echo "🚀 Starting CodeLlama Fine-tuning with Chat Format Dataset"
14
+ echo "======================================================================"
15
+
16
+ # Configuration
17
+ BASE_MODEL="models/base-models/CodeLlama-7B-Instruct"
18
+ TRAIN_DATASET="datasets/processed/split_chat_format/train.jsonl"
19
+ VAL_DATASET="datasets/processed/split_chat_format/val.jsonl"
20
+ OUTPUT_DIR="training-outputs/codellama-fifo-v2-chat"
21
+
22
+ # Check if datasets exist
23
+ if [ ! -f "$TRAIN_DATASET" ]; then
24
+ echo "❌ Error: Training dataset not found: $TRAIN_DATASET"
25
+ exit 1
26
+ fi
27
+
28
+ if [ ! -f "$VAL_DATASET" ]; then
29
+ echo "❌ Error: Validation dataset not found: $VAL_DATASET"
30
+ exit 1
31
+ fi
32
+
33
+ echo "📊 Configuration:"
34
+ echo " Base Model: $BASE_MODEL"
35
+ echo " Train Dataset: $TRAIN_DATASET"
36
+ echo " Val Dataset: $VAL_DATASET"
37
+ echo " Output Directory: $OUTPUT_DIR"
38
+ echo ""
39
+
40
+ # Start training
41
+ # Note: val-dataset is auto-detected if val.jsonl exists in same directory as train.jsonl
42
+ python3 scripts/training/finetune_codellama.py \
43
+ --base-model "$BASE_MODEL" \
44
+ --dataset "$TRAIN_DATASET" \
45
+ --output-dir "$OUTPUT_DIR" \
46
+ --max-length 1536 \
47
+ --num-epochs 5 \
48
+ --learning-rate 2e-5 \
49
+ --batch-size 4 \
50
+ --gradient-accumulation 4 \
51
+ --lora-r 48 \
52
+ --lora-alpha 96 \
53
+ --lora-dropout 0.15 \
54
+ --resume-from-checkpoint auto
55
+
56
+ echo ""
57
+ echo "======================================================================"
58
+ echo "✅ Training started!"
59
+ echo "======================================================================"
60
+