Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (54 loc) · 2.02 KB
/
Copy pathMakefile
File metadata and controls
73 lines (54 loc) · 2.02 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
VENV := /goinfre/$(USER)/rag/.venv
UV_ENV := UV_PROJECT_ENVIRONMENT=$(VENV)
install:
$(UV_ENV) uv sync
run:
$(UV_ENV) uv run python -m src index
debug:
$(UV_ENV) uv run python -m pdb -m src
clean:
$(UV_ENV) find . -type d -name "__pycache__" -exec rm -rf {} +
$(UV_ENV) find . -type d -name ".mypy_cache" -exec rm -rf {} +
$(UV_ENV) find . -type d -name ".pytest_cache" -exec rm -rf {} +
fclean: clean
cd /goinfre/$(USER)/ && rm -rf rag/
$(UV_ENV) rm -rf data/processed data/output
lint:
$(UV_ENV) uv run flake8 src
$(UV_ENV) uv run mypy src --warn-return-any --warn-unused-ignores \
--ignore-missing-imports --disallow-untyped-defs --check-untyped-defs
lint-strict:
$(UV_ENV) uv run flake8 src
$(UV_ENV) uv run mypy src --warn-return-any --warn-unused-ignores \
--ignore-missing-imports --disallow-untyped-defs --check-untyped-defs \
--strict
K = 5
MAX_CHUNK_SIZE = 2000
SPLIT = public
DATASET = dataset_docs_$(SPLIT).json
SEARCH_DIR = data/output/search_results/UnansweredQuestions
ANSWER_DIR = data/output/search_results_and_answer/UnansweredQuestions
Q = What is vLLM?
index:
$(UV_ENV) uv run python -m src index --max_chunk_size $(MAX_CHUNK_SIZE)
search:
$(UV_ENV) uv run python -m src search "$(Q)" --k $(K)
search-dataset:
$(UV_ENV) uv run python -m src search_dataset \
--dataset_path data/datasets/UnansweredQuestions/$(DATASET) \
--k $(K) --save_directory $(SEARCH_DIR)
evaluate:
$(UV_ENV) uv run python -m src evaluate \
--student_search_results_path $(SEARCH_DIR)/$(DATASET) \
--dataset_path data/datasets/AnsweredQuestions/$(DATASET)
answer:
$(UV_ENV) uv run python -m src answer "$(Q)" --k $(K)
answer-dataset:
$(UV_ENV) uv run python -m src answer_dataset \
--student_search_results_path $(SEARCH_DIR)/$(DATASET) \
--save_directory $(ANSWER_DIR)
script:
$(UV_ENV) ./exams/scripts/exam_retrieval.sh --student-path . --moulinette-path ./moulinette_pkg/moulinette-ubuntu
.PHONY: install run debug clean fclean lint lint-strict
.PHONY: index search search-dataset evaluate answer answer-dataset
.PHONY: script