-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 1.27 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
VERSION := $(shell git describe --tags --always --dirty)
COMMIT := $(shell git rev-parse --short HEAD)
install:
go mod download
build:
CGO_ENABLED=0 go build -ldflags="-w -s -X main.version=${VERSION} -X main.commit=${COMMIT}" -o chopdoc ./chopdoc.go
test:
go test -v ./...
lint:
golangci-lint run --verbose
lint-fix:
golangci-lint run --verbose --fix
release-draft:
goreleaser release --snapshot --draft
pipe:
cat ./tests/pg_essay.txt | go run ./chopdoc.go
compare-recursive:
# in practice langchain is doing extra cleaning "trim", so we must specify clean=trim
# size 60, overlap 0
go run ./chopdoc.go -input ./tests/pg_essay.txt -output ./tests/recursive_60_0_go.jsonl -size 60 -overlap 0 -method recursive -clean trim
cd tests && uv run ./recursive.py --size 60 --overlap 0 --input ./pg_essay.txt --output ./recursive_60_0_py.jsonl
cd tests && uv run ./diff.py ./recursive_60_0_py.jsonl ./recursive_60_0_go.jsonl
# size 375, overlap 0
go run ./chopdoc.go -input ./tests/pg_essay.txt -output ./tests/recursive_375_0_go.jsonl -size 375 -overlap 0 -method recursive -clean trim
cd tests && uv run ./recursive.py --size 375 --overlap 0 --input ./pg_essay.txt --output ./recursive_375_0_py.jsonl
cd tests && uv run ./diff.py ./recursive_375_0_py.jsonl ./recursive_375_0_go.jsonl