Buckets:
83.3 GB
3,227 files
Updated about 1 month ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| CMakeLists.txt | 304 Bytes xet | 1136bfee | |
| README.md | 1.58 kB xet | 8681c203 | |
| completions.txt | 6.91 kB xet | dc643674 | |
| cvector-generator.cpp | 18.5 kB xet | 271b30ad | |
| mean.hpp | 1.53 kB xet | 85c8141c | |
| negative.txt | 989 Bytes xet | c9b1bc96 | |
| pca.hpp | 11.4 kB xet | 11327fcb | |
| positive.txt | 955 Bytes xet | 68d9ad71 |
cvector-generator
This example demonstrates how to generate a control vector using gguf models.
Related PRs:
- Add support for control vectors
- (Issue) Generate control vector using llama.cpp
- Add cvector-generator example
Examples
# CPU only
./cvector-generator -m ./llama-3.Q4_K_M.gguf
# With GPU
./cvector-generator -m ./llama-3.Q4_K_M.gguf -ngl 99
# With advanced options
./cvector-generator -m ./llama-3.Q4_K_M.gguf -ngl 99 --pca-iter 2000 --pca-batch 100
# Using mean value instead of PCA
./cvector-generator -m ./llama-3.Q4_K_M.gguf --method mean
# To see help message
./cvector-generator -h
# Then, have a look at "cvector" section
Tips and tricks
If you have multiple lines per prompt, you can escape the newline character (change it to \n). For example:
<|im_start|>system\nAct like a person who is extremely happy.<|im_end|>
<|im_start|>system\nYou are in a very good mood today<|im_end|>
Example to use output file with llama-cli:
(Tips: The control vector works better when apply to layers higher than 10)
./llama-cli -m ./llama-3.Q4_K_M.gguf -p "<|start_header_id|>system<|end_header_id|>\n\nYou are a helpful assistant<|eot_id|><|start_header_id|>user<|end_header_id|>\n\nSing a song<|im_end|><|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" --special --control-vector-scaled ./control_vector.gguf 0.8 --control-vector-layer-range 10 31
- Total size
- 83.3 GB
- Files
- 3,227
- Last updated
- Jul 8
- Pre-warmed CDN
- US EU US EU