-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (43 loc) · 2.03 KB
/
Copy pathMakefile
File metadata and controls
60 lines (43 loc) · 2.03 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
# Makefile for rag-retrieval-benchmark.
#
# Most commands run inside the Docker services. `make up` builds and starts the
# stack; the data/index/evaluate commands run one-off processes in the `api`
# image (which has the package and GPU access).
COMPOSE := docker compose
# Run one-off commands in a throwaway container based on the api service.
RUN := $(COMPOSE) run --rm api
.DEFAULT_GOAL := help
.PHONY: help up down logs jupyter build download-data prepare-data index retrieve evaluate test lint format
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
build: ## Build the Docker images
$(COMPOSE) build
up: ## Build and start all services (qdrant + jupyter + api)
$(COMPOSE) up -d --build
down: ## Stop and remove all services
$(COMPOSE) down
logs: ## Follow logs from all services
$(COMPOSE) logs -f
jupyter: ## Print the JupyterLab URL (token is disabled for local dev)
@echo "JupyterLab: http://localhost:8888/lab"
@$(COMPOSE) logs jupyter | tail -n 15 || true
download-data: ## Download the BEIR SciFact dataset into data/raw/
$(RUN) python -m rag_retrieval_benchmark.data.download
prepare-data: ## Normalize raw data into data/processed/*.jsonl
$(RUN) python -m rag_retrieval_benchmark.data.prepare
index: ## Embed the corpus and index it into Qdrant
$(RUN) python -m rag_retrieval_benchmark.indexing.build_index
retrieve: ## Run a sample retrieval query (override with QUERY=..., METHOD=..., TOP_K=...)
$(RUN) python -m rag_retrieval_benchmark.cli retrieve \
--query "$(or $(QUERY),Does the claim have supporting evidence?)" \
--method "$(or $(METHOD),dense)" \
--top-k "$(or $(TOP_K),5)"
evaluate: ## Run the full benchmark and generate the report
$(RUN) python -m rag_retrieval_benchmark.evaluation.runner
test: ## Run the test suite
$(RUN) pytest
lint: ## Run the linter
$(RUN) ruff check .
format: ## Auto-format the code
$(RUN) ruff format .