forked from ariannamethod/leo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 1.01 KB
/
Copy pathMakefile
File metadata and controls
44 lines (33 loc) · 1.01 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
CC ?= cc
CFLAGS ?= -O2 -Wall
LDFLAGS = -lm -lsqlite3 -lpthread
.PHONY: all clean neoleo inner test
# Default: build Leo with D.N.A.
all: leo
# Standalone organism (C only, with D.N.A.)
leo: leo.c leo.h
$(CC) $(CFLAGS) -DLEO_HAS_DNA leo.c $(LDFLAGS) -o $@
# Without D.N.A. — pure weightless organism
leo-naked: leo.c
$(CC) $(CFLAGS) leo.c $(LDFLAGS) -o $@
# Single-file organism (neoleo.c = leo.c + leo.h inline)
neoleo: neoleo.c
$(CC) $(CFLAGS) neoleo.c $(LDFLAGS) -o $@
neoleo.c: leo.c leo.h tools/make_neoleo.sh
bash tools/make_neoleo.sh
# Inner world (Go + CGO)
inner:
cd inner && go build -o ../leo_inner .
# Run tests
test: leo
cd inner && go test -v ./...
# Extract D.N.A. from GGUF weights (requires Go + GGUF file)
# Usage: make dna GGUF=path/to/model.gguf
dna:
go run tools/extract_dna.go $(GGUF) > leo.h
# Generate bootstrap dataset
leo.txt:
go run tools/gen_leo_txt.go > leo.txt
clean:
rm -f leo leo-naked neoleo leo_inner neoleo.c
rm -f *.o *.db *.db-journal *.db-wal *.db-shm *.db.state