-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (40 loc) · 1.25 KB
/
Makefile
File metadata and controls
48 lines (40 loc) · 1.25 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
.PHONY: install clean train inference evaluate test
# Default config and checkpoint paths
CONFIG ?= configs/default.yaml
CHECKPOINT ?= checkpoints/merged_model
DATASET ?= gsm8k
N_CANDIDATES ?= 16
N_PROBLEMS ?= 100
# Installation
install:
pip install --upgrade pip
pip install -e .
# Cleaning
clean:
rm -rf __pycache__ .pytest_cache
find . -name "*.pyc" -delete
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
# Deep clean (removes checkpoints and logs too)
clean-all: clean
rm -rf logs/* checkpoints/*
# Training wrapper
# Usage: make train CONFIG=configs/default.yaml
train:
python scripts/train.py --config $(CONFIG)
# Inference wrapper
# Usage: make inference CHECKPOINT=checkpoints/merged_model
# Usage: make inference CHECKPOINT=checkpoints/merged_model PROBLEM="Solve: 2x + 5 = 15"
inference:
ifdef PROBLEM
python scripts/inference.py --model_path $(CHECKPOINT) --problem "$(PROBLEM)"
else
python scripts/inference.py --model_path $(CHECKPOINT)
endif
# Evaluation
# Usage: make evaluate CHECKPOINT=checkpoints/merged_model DATASET=gsm8k N_CANDIDATES=16
evaluate:
python scripts/evaluate.py --model_path $(CHECKPOINT) --dataset $(DATASET) \
--n_candidates $(N_CANDIDATES) --n_problems $(N_PROBLEMS)
# Tests
test:
python -m pytest