Debian Codegraph @

test/command/suite/language_model/options/k/minus/one.test

raw
1 #@require-env GRN_LANGUAGE_MODEL_DOWNLOAD_CACHE_DIR
2 #@require-feature llama.cpp
3
4 #@on-error omit
5 plugin_register language_model/knn
6 #@on-error default
7
8 table_create Data TABLE_NO_KEY
9 column_create Data text COLUMN_SCALAR ShortText
10 column_create Data rabitq_code COLUMN_SCALAR ShortBinary
11
12 load --table Data
13 [
14 {"text": "I am a boy."},
15 {"text": "This is an apple."},
16 {"text": "Groonga is a full text search engine."},
17 {"text": "This is an orange."},
18 {"text": "This is a banana."},
19 {"text": "This is a tomato."},
20 {"text": "This is a carrot."},
21 {"text": "This is a cucumber."},
22 {"text": "This is a pepper."},
23 {"text": "This is a potato."},
24 {"text": "This is a onion."}
25 ]
26
27 table_create RaBitQ TABLE_HASH_KEY ShortBinary \
28 --default_tokenizer \
29 'TokenLanguageModelKNN("model", "hf:///groonga/multilingual-e5-base-Q4_K_M-GGUF", \
30 "code_column", "rabitq_code", \
31 "passage_prefix", "passage: ", \
32 "query_prefix", "query: ")'
33 # This is for waiting for downloading model.
34 #@timeout 300
35 #@read-timeout 300
36 column_create RaBitQ data_text COLUMN_INDEX Data text
37
38 select Data \
39 --filter 'language_model_knn(text, "male child", { "k" : -1 })' \
40 --output_columns text