add print_usage
This commit is contained in:
parent
b22c8459ff
commit
c59bfa6368
3 changed files with 14 additions and 5 deletions
|
@ -1636,7 +1636,7 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
|
||||||
params.cvector_negative_file = argv[i];
|
params.cvector_negative_file = argv[i];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (arg == "--num-completions") {
|
if (arg == "--completions") {
|
||||||
if (++i >= argc) {
|
if (++i >= argc) {
|
||||||
invalid_param = true;
|
invalid_param = true;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1986,7 +1986,7 @@ void gpt_params_print_usage(int /*argc*/, char ** argv, const gpt_params & param
|
||||||
options.push_back({ "control-vector-generator", "--positive-file FNAME", "positive prompts file, one prompt per line (default: '%s')", params.cvector_positive_file.c_str() });
|
options.push_back({ "control-vector-generator", "--positive-file FNAME", "positive prompts file, one prompt per line (default: '%s')", params.cvector_positive_file.c_str() });
|
||||||
options.push_back({ "control-vector-generator", "--negative-file FNAME", "negative prompts file, one prompt per line (default: '%s')", params.cvector_negative_file.c_str() });
|
options.push_back({ "control-vector-generator", "--negative-file FNAME", "negative prompts file, one prompt per line (default: '%s')", params.cvector_negative_file.c_str() });
|
||||||
options.push_back({ "control-vector-generator", "--completions-file FNAME","completions file (default: '%s')", params.cvector_completions_file.c_str() });
|
options.push_back({ "control-vector-generator", "--completions-file FNAME","completions file (default: '%s')", params.cvector_completions_file.c_str() });
|
||||||
options.push_back({ "control-vector-generator", "--num-completions N", "number of lines of completions file to use (default: %d)", params.n_completions });
|
options.push_back({ "control-vector-generator", "--completions N", "number of lines of completions file to use (default: %d)", params.n_completions });
|
||||||
options.push_back({ "control-vector-generator", "--batch-pca N", "batch size used for PCA. Larger batch runs faster, but uses more memory (default: %d)", params.n_pca_batch });
|
options.push_back({ "control-vector-generator", "--batch-pca N", "batch size used for PCA. Larger batch runs faster, but uses more memory (default: %d)", params.n_pca_batch });
|
||||||
options.push_back({ "control-vector-generator", "--iter-pca N", "number of iterations used for PCA (default: %d)", params.n_pca_iterations });
|
options.push_back({ "control-vector-generator", "--iter-pca N", "number of iterations used for PCA (default: %d)", params.n_pca_iterations });
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ Example:
|
||||||
./control-vector-generator -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf -ngl 99
|
./control-vector-generator -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf -ngl 99
|
||||||
|
|
||||||
# With advanced options
|
# With advanced options
|
||||||
./control-vector-generator -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf -ngl 99 --num-completions 128 --pca-iter 2000 --batch-pca 100
|
./control-vector-generator -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf -ngl 99 --completions 128 --pca-iter 2000 --batch-pca 100
|
||||||
|
|
||||||
# To see help message
|
# To see help message
|
||||||
./control-vector-generator -h
|
./control-vector-generator -h
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
// utils
|
||||||
|
|
||||||
template <class Iter>
|
template <class Iter>
|
||||||
static std::string tokens_to_str(llama_context * ctx, Iter begin, Iter end) {
|
static std::string tokens_to_str(llama_context * ctx, Iter begin, Iter end) {
|
||||||
|
@ -34,6 +34,15 @@ static std::string tokens_to_str(llama_context * ctx, Iter begin, Iter end) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void print_usage(int argc, char ** argv, const gpt_params & params) {
|
||||||
|
gpt_params_print_usage(argc, argv, params);
|
||||||
|
|
||||||
|
printf("\nexample usage:\n");
|
||||||
|
printf("\n CPU only: %s -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf\n", argv[0]);
|
||||||
|
printf("\n with GPU: %s -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf -ngl 99\n", argv[0]);
|
||||||
|
printf("\n advanced: %s -m ./dolphin-2.0-mistral-7b.Q4_K_M.gguf -ngl 99 --completions 128 --pca-iter 2000 --batch-pca 100\n", argv[0]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -384,7 +393,7 @@ int main(int argc, char ** argv) {
|
||||||
gpt_params params;
|
gpt_params params;
|
||||||
|
|
||||||
if (!gpt_params_parse(argc, argv, params)) {
|
if (!gpt_params_parse(argc, argv, params)) {
|
||||||
gpt_params_print_usage(argc, argv, params);
|
print_usage(argc, argv, params);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue