Skip to content

Commit 3223133

Browse files
committed
default n_pca_batch to 20
1 parent d41c719 commit 3223133

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

examples/control-vector-generator/control-vector-generator.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ struct train_context {
246246
struct ctrl_params {
247247
/* default meta parameters */
248248
int n_completions = INT_MAX;
249-
int n_pca_batch = 5;
249+
int n_pca_batch = 20;
250250
int n_pca_iterations = 1000;
251251

252252
/* default filepaths */
@@ -294,6 +294,7 @@ static std::string to_string(const T & val) {
294294
}
295295

296296
static void print_usage(const char * executable) {
297+
struct ctrl_params defaults;
297298
printf("\n");
298299
printf("usage: %s [options] -m <model> [gpt-opts]", executable);
299300
printf("\n");
@@ -302,19 +303,19 @@ static void print_usage(const char * executable) {
302303
printf("options:\n");
303304
printf(" -h, --help show this help message and exit\n");
304305
printf(" -o, --outfile output file\n");
305-
printf(" default: 'control_vector.gguf'\n");
306+
printf(" default: %s\n", defaults.outfile.c_str());
306307
printf(" -pf, --positive-file positive prompts file, one prompt per line\n");
307-
printf(" default: 'examples/control-vector-generator/positive.txt'\n");
308+
printf(" default: %s\n", defaults.positive_prompts_file.c_str());
308309
printf(" -nf, --negative-file negative prompts file, one prompt per line\n");
309-
printf(" default: 'examples/control-vector-generator/negative.txt'\n");
310+
printf(" default: %s\n", defaults.negative_prompts_file.c_str());
310311
printf(" -cf, --completions-file completions file\n");
311-
printf(" default: 'examples/control-vector-generator/completions.txt'\n");
312+
printf(" default: %s\n", defaults.completions_file.c_str());
312313
printf(" -nc, --num-completions N number of lines of completions file to use\n");
313-
printf(" default: 64\n");
314-
printf(" --batch-pca N batch size used for PCA\n");
315-
printf(" default: 5\n");
314+
printf(" default: use all lines\n");
315+
printf(" --batch-pca N batch size used for PCA. Larger batch runs faster, but uses more memory\n");
316+
printf(" default: %d\n", defaults.n_pca_batch);
316317
printf(" --iter-pca N number of iterations used for PCA\n");
317-
printf(" default: 1000\n");
318+
printf(" default: %d\n", defaults.n_pca_iterations);
318319
printf("\n");
319320
printf("gpt-opts:\n");
320321
printf(" other options from main\n");

examples/control-vector-generator/pca.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace PCA {
3535
// input params for PCA computations
3636
struct pca_params {
3737
int n_threads = 1;
38-
int n_batch = 5; // number of iterations do to in one batch. larger the batch, more memory is used
38+
int n_batch = 20; // number of iterations do to in one batch. larger the batch, more memory is used
3939
int n_iterations = 1000;
4040
float tolerance = 1e-7;
4141

0 commit comments

Comments
 (0)