-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 860 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 860 Bytes
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
# Makefile for generating and converting a minimal GGUF model
VENV_DIR := .venv
PYTHON := $(VENV_DIR)/bin/python
LLAMA_DIR := llama.cpp
MODEL_DIR := tiny-llama
GGUF_FILE := tiny-llama.gguf
.PHONY: all clean
all: $(GGUF_FILE)
$(VENV_DIR)/bin/activate:
python3 -m venv $(VENV_DIR)
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install -r requirements.txt
$(LLAMA_DIR):
git clone https://github.com/ggerganov/llama.cpp.git
$(PYTHON) -m pip install -r $(LLAMA_DIR)/requirements.txt
$(MODEL_DIR): $(VENV_DIR)/bin/activate
$(PYTHON) generate.py
$(MODEL_DIR)/tokenizer.model:
cp tokenizer.model $(MODEL_DIR)/tokenizer.model
$(GGUF_FILE): $(MODEL_DIR) $(MODEL_DIR)/tokenizer.model $(LLAMA_DIR)
$(PYTHON) $(LLAMA_DIR)/convert_hf_to_gguf.py $(MODEL_DIR) --outfile $(GGUF_FILE)
clean:
rm -rf $(VENV_DIR) $(LLAMA_DIR) $(MODEL_DIR) $(GGUF_FILE)