-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (36 loc) · 1.29 KB
/
Makefile
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
VENVDIR = .venv
PYTHONBASE = python3
PYTHON = $(VENVDIR)/bin/python3
PIP = $(VENVDIR)/bin/pip
ACTIVATE = . $(VENVDIR)/bin/activate
.PHONY: help venv clean rag
help:
@echo "Usage: make [target]"
@echo
@echo "Available targets:"
@echo
@echo " help (def) shows possible targets"
@echo " clean removes all automatically-generated files,"
@echo " such as cloned repositories and vector stores"
@echo " venv creates a python virtual environment at '$(VENVDIR)'"
@echo " dataset pulls the content and process the dataset"
@echo " rag calls the RAG application"
clean:
rm tmp/ chroma_db/ downloads/ .venv/ -rf
venv: $(VENVDIR)/bin/activate
dataset: ./tmp/final
rag: $(VENVDIR)/bin/activate
@$(ACTIVATE) && $(PYTHON) -m rag.rag
./downloads: dataset_config.yaml $(VENVDIR)/bin/activate
@echo "Pulling content"
@$(ACTIVATE) && $(PYTHON) -m dataset.pull_content
./tmp/final: ./downloads $(VENVDIR)/bin/activate
@echo "Processing dataset"
@$(ACTIVATE) && $(PYTHON) -m dataset.process
# Virtual environment
$(VENVDIR)/bin/activate:
@echo "Creating a new virtual environment..."
@$(PYTHONBASE) -m venv $(VENVDIR)
@echo "Installing dependencies..."
@$(ACTIVATE) && $(PIP) install -r requirements.txt --no-deps
@echo "Dependencies installed."