-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (73 loc) · 2.55 KB
/
Copy pathMakefile
File metadata and controls
93 lines (73 loc) · 2.55 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Makefile for LLM Fine-Tuning Lab
.PHONY: help install dev-install clean test lint format docker-build docker-run
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies
pip install -r requirements.txt
pip install -e .
dev-install: ## Install development dependencies
pip install -r requirements.txt
pip install -e ".[dev]"
pip install black flake8 isort mypy pytest pytest-cov
clean: ## Clean build artifacts and caches
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name '*.pyc' -delete
find . -type f -name '*.pyo' -delete
test: ## Run tests
pytest tests/ -v --cov=src --cov-report=html --cov-report=term
lint: ## Run linters
black --check src/ scripts/
flake8 src/ scripts/ --max-line-length=120
isort --check-only src/ scripts/
mypy src/
format: ## Format code
black src/ scripts/
isort src/ scripts/
docker-build: ## Build Docker image
docker-compose build
docker-run: ## Run Docker containers
docker-compose up -d
docker-stop: ## Stop Docker containers
docker-compose down
docker-logs: ## View Docker logs
docker-compose logs -f
train-summarizer: ## Train summarization model
python scripts/train_summarizer.py \
--config configs/summarization.yaml \
--data datasets/processed/gov_articles.json \
--output checkpoints/summarizer-v1
train-classifier: ## Train classification model
python scripts/train_classifier.py \
--config configs/classification.yaml \
--data datasets/processed/labeled_articles.json \
--output checkpoints/classifier-v1
prepare-data: ## Prepare training data from SynthoraAI
python scripts/prepare_data.py \
--task summarization \
--limit 5000 \
--output datasets/processed/gov_articles.json
evaluate: ## Evaluate model
python scripts/evaluate.py \
--model checkpoints/summarizer-v1 \
--test-data datasets/processed/test.json \
--task summarization
export-model: ## Export model for production
python scripts/export.py \
--model checkpoints/summarizer-v1 \
--output exports/summarizer \
--format onnx \
--quantize
jupyter: ## Start Jupyter Lab
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser
tensorboard: ## Start TensorBoard
tensorboard --logdir=runs --port=6006
setup: install ## Initial setup
mkdir -p checkpoints datasets logs outputs runs
cp .env.example .env
@echo "Setup complete! Edit .env with your API keys."