blob: 534001e80a7f434d984efb1b1d29f9233a5e484f (
plain)
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
|
# cheat
Local command-helper retrieval system using JSONL, SQLite, and sentence-transformers.
## Setup
```sh
export HF_HOME="$PWD/models/hf"
export SENTENCE_TRANSFORMERS_HOME="$PWD/models/hf"
python -m venv venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
python scripts/init_db.py
python scripts/build_index.py
```
Then run a query like this:
```sh
python scripts/query_index.py "get free disk space"
```
To add commands, add to `./cards.jsonl` and rebuild the index:
```sh
python scripts/build_index.py
```
|