-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
96 lines (77 loc) · 2.09 KB
/
Copy pathjustfile
File metadata and controls
96 lines (77 loc) · 2.09 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
export PYTHONUNBUFFERED := "1"
brag-cache := ".brag"
docs := brag-cache / "docs"
name := "brag"
version := `uv run brag version --short`
tag := version + "-" + `arch`
sqfs := name + "-" + tag + ".sqfs"
help:
just -l -u
# Lint and format code.
lint:
uv run pre-commit run -a
# Update git tag and push tag. GitHub Actions will then publish to PyPI.
bump kind:
uv run bump {{ kind }} -p
# Install git hooks
install-precommit:
uv run pre-commit install
# Create binary for brag for current platform.
build:
time uv run pyinstaller \
--onefile $(uv run which brag) \
-n brag-$(uv run brag version --short)-$(arch)
demo-corpus:
mkdir -p {{ docs }}
curl -L https://arxiv.org/pdf/1706.03762 -o {{ docs }}/attention.pdf
curl -L https://arxiv.org/pdf/2106.05403 -o {{ docs }}/aibd.pdf
curl -L https://www.gutenberg.org/cache/epub/1342/pg1342.txt -o {{ docs }}/pride-and-prejudice.txt
index:
uv run brag index -d {{ docs }} --batchsize=32
index-ollama:
uv run brag index -d {{ docs }} --emb=ollama/nomic-embed-text --batchsize=32
ask:
uv run brag ask -d {{ docs }}
ask-ollama:
uv run brag ask -d {{ docs }} --emb=ollama/nomic-embed-text
search query:
uv run brag search -d {{ docs }} -q "{{ query }}"
chat:
uv run brag chat
[confirm("Remove index?")]
clean:
rm -rf .brag/db
ascii:
uvx pyfiglet -f slant brag
# Build wheel and sqfs
wcc: wheel cc
# Build wheel
[private]
wheel:
[ ! -d "dist" ] || rm -rf dist/*.whl
uv build .
# Build sqfs, assumes wheel exists
[private]
cc:
#!/bin/bash
module load charliecloud
unset CH_IMAGE_AUTH
ch-image build -t {{ name }}:{{ tag }} .
ch-convert {{ name }}:{{ tag }} {{ sqfs }}
shell:
#!/bin/bash
module load charliecloud
unset CH_IMAGE_AUTH
ch-run -W {{ name }}:{{ tag }} \
--unset-env='*' \
--set-env \
-- bash
shell-test:
#!/bin/bash
module load charliecloud
unset CH_IMAGE_AUTH
ch-run -W {{ name }}:{{ tag }} \
--unset-env='*' \
--bind misc:/docs \
--set-env \
-- bash