@@ -1470,14 +1470,14 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
1470
1470
[](common_params & params) {
1471
1471
params.ctx_shift = false ;
1472
1472
}
1473
- ).set_examples ({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_PERPLEXITY}).set_env (" LLAMA_ARG_NO_CONTEXT_SHIFT" ));
1473
+ ).set_examples ({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }).set_env (" LLAMA_ARG_NO_CONTEXT_SHIFT" ));
1474
1474
add_opt (common_arg (
1475
1475
{" --chunks" }, " N" ,
1476
1476
string_format (" max number of chunks to process (default: %d, -1 = all)" , params.n_chunks ),
1477
1477
[](common_params & params, int value) {
1478
1478
params.n_chunks = value;
1479
1479
}
1480
- ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_RETRIEVAL}));
1480
+ ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE, LLAMA_EXAMPLE_RETRIEVAL}));
1481
1481
add_opt (common_arg (
1482
1482
{" -fa" , " --flash-attn" },
1483
1483
string_format (" enable Flash Attention (default: %s)" , params.flash_attn ? " enabled" : " disabled" ),
@@ -1539,7 +1539,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
1539
1539
}
1540
1540
params.in_files .push_back (value);
1541
1541
}
1542
- ).set_examples ({LLAMA_EXAMPLE_IMATRIX}));
1542
+ ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_FINETUNE }));
1543
1543
add_opt (common_arg (
1544
1544
{" -bf" , " --binary-file" }, " FNAME" ,
1545
1545
" binary file containing the prompt (default: none)" ,
@@ -2115,70 +2115,70 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
2115
2115
[](common_params & params) {
2116
2116
params.hellaswag = true ;
2117
2117
}
2118
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2118
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2119
2119
add_opt (common_arg (
2120
2120
{" --hellaswag-tasks" }, " N" ,
2121
2121
string_format (" number of tasks to use when computing the HellaSwag score (default: %zu)" , params.hellaswag_tasks ),
2122
2122
[](common_params & params, int value) {
2123
2123
params.hellaswag_tasks = value;
2124
2124
}
2125
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2125
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2126
2126
add_opt (common_arg (
2127
2127
{" --winogrande" },
2128
2128
" compute Winogrande score over random tasks from datafile supplied with -f" ,
2129
2129
[](common_params & params) {
2130
2130
params.winogrande = true ;
2131
2131
}
2132
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2132
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2133
2133
add_opt (common_arg (
2134
2134
{" --winogrande-tasks" }, " N" ,
2135
2135
string_format (" number of tasks to use when computing the Winogrande score (default: %zu)" , params.winogrande_tasks ),
2136
2136
[](common_params & params, int value) {
2137
2137
params.winogrande_tasks = value;
2138
2138
}
2139
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2139
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2140
2140
add_opt (common_arg (
2141
2141
{" --multiple-choice" },
2142
2142
" compute multiple choice score over random tasks from datafile supplied with -f" ,
2143
2143
[](common_params & params) {
2144
2144
params.multiple_choice = true ;
2145
2145
}
2146
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2146
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2147
2147
add_opt (common_arg (
2148
2148
{" --multiple-choice-tasks" }, " N" ,
2149
2149
string_format (" number of tasks to use when computing the multiple choice score (default: %zu)" , params.multiple_choice_tasks ),
2150
2150
[](common_params & params, int value) {
2151
2151
params.multiple_choice_tasks = value;
2152
2152
}
2153
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2153
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2154
2154
add_opt (common_arg (
2155
2155
{" --kl-divergence" },
2156
2156
" computes KL-divergence to logits provided via --kl-divergence-base" ,
2157
2157
[](common_params & params) {
2158
2158
params.kl_divergence = true ;
2159
2159
}
2160
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2160
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2161
2161
add_opt (common_arg (
2162
2162
{" --save-all-logits" , " --kl-divergence-base" }, " FNAME" ,
2163
2163
" set logits file" ,
2164
2164
[](common_params & params, const std::string & value) {
2165
2165
params.logits_file = value;
2166
2166
}
2167
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2167
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2168
2168
add_opt (common_arg (
2169
2169
{" --ppl-stride" }, " N" ,
2170
2170
string_format (" stride for perplexity calculation (default: %d)" , params.ppl_stride ),
2171
2171
[](common_params & params, int value) {
2172
2172
params.ppl_stride = value;
2173
2173
}
2174
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2174
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2175
2175
add_opt (common_arg (
2176
2176
{" --ppl-output-type" }, " <0|1>" ,
2177
2177
string_format (" output type for perplexity calculation (default: %d)" , params.ppl_output_type ),
2178
2178
[](common_params & params, int value) {
2179
2179
params.ppl_output_type = value;
2180
2180
}
2181
- ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY}));
2181
+ ).set_examples ({LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_FINETUNE }));
2182
2182
add_opt (common_arg (
2183
2183
{" -dt" , " --defrag-thold" }, " N" ,
2184
2184
string_format (" KV cache defragmentation threshold (default: %.1f, < 0 - disabled)" , (double )params.defrag_thold ),
@@ -2609,9 +2609,9 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
2609
2609
{" -o" , " --output" , " --output-file" }, " FNAME" ,
2610
2610
string_format (" output file (default: '%s')" , params.out_file .c_str ()),
2611
2611
[](common_params & params, const std::string & value) {
2612
- params.out_file = value;
2612
+ params.out_file = value;
2613
2613
}
2614
- ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_CVECTOR_GENERATOR, LLAMA_EXAMPLE_EXPORT_LORA, LLAMA_EXAMPLE_TTS}));
2614
+ ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_CVECTOR_GENERATOR, LLAMA_EXAMPLE_EXPORT_LORA, LLAMA_EXAMPLE_TTS, LLAMA_EXAMPLE_FINETUNE }));
2615
2615
add_opt (common_arg (
2616
2616
{" -ofreq" , " --output-frequency" }, " N" ,
2617
2617
string_format (" output the imatrix every N iterations (default: %d)" , params.n_out_freq ),
@@ -3423,5 +3423,73 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
3423
3423
}
3424
3424
).set_examples ({LLAMA_EXAMPLE_SERVER}));
3425
3425
3426
+ add_opt (common_arg (
3427
+ {" --dataset-format" }, " " ,
3428
+ string_format (" type of input data (e.g., 'text', 'parquet') (default: %s)" , params.dataset_format .c_str ()),
3429
+ [](common_params & params, const std::string & format) {
3430
+ params.dataset_format = format; // TODO ENUM CLASS
3431
+ }
3432
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3433
+
3434
+ add_opt (common_arg (
3435
+ {" --max-seq-len" }, " " ,
3436
+ string_format (" max sequence length (default: %d)" , params.max_seq_len ),
3437
+ [](common_params & params, int32_t max_seq_len) {
3438
+ params.max_seq_len = max_seq_len;
3439
+ }
3440
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3441
+
3442
+ add_opt (common_arg (
3443
+ {" --pre-tokenized" },
3444
+ string_format (" input file contains pre-tokenized data (space-separated token IDs)" ),
3445
+ [](common_params & params) {
3446
+ params.pre_tokenized = true ;
3447
+ }
3448
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3449
+
3450
+ add_opt (common_arg (
3451
+ {" --preview" },
3452
+ string_format (" read and print metadata and first sequence from the output GGUF file (enables preview)" ),
3453
+ [](common_params & params) {
3454
+ params.do_preview = true ;
3455
+ }
3456
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3457
+
3458
+ add_opt (common_arg (
3459
+ {" --preview-count" }, " <N>" ,
3460
+ string_format (" input file contains pre-tokenized data (space-separated token IDs)" ),
3461
+ [](common_params & params, int preview_count) {
3462
+ params.preview_count = preview_count;
3463
+ }
3464
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3465
+
3466
+ add_opt (common_arg (
3467
+ {" --detokenize-preview" },
3468
+ string_format (" detokenize previewed sequences (implies --preview)" ),
3469
+ [](common_params & params) {
3470
+ params.detokenize_preview = params.do_preview = true ;
3471
+ }
3472
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3473
+
3474
+ #ifdef LLAMA_PARQUET
3475
+
3476
+
3477
+ add_opt (common_arg (
3478
+ {" --parquet-text-column" }, " <name>" ,
3479
+ string_format (" column name for raw text in Parquet files (default: 'text')" ),
3480
+ [](common_params & params, const std::string &parquet_text_column) {
3481
+ params.parquet_text_column = parquet_text_column;
3482
+ }
3483
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3484
+
3485
+ add_opt (common_arg (
3486
+ {" --parquet-tokens-column" }, " <name>" ,
3487
+ string_format (" column name for pre-tokenized data (list<int32>) in Parquet files (default: 'tokens')" ),
3488
+ [](common_params & params, const std::string &parquet_tokens_column) {
3489
+ params.parquet_tokens_column = parquet_tokens_column;
3490
+ }
3491
+ ).set_examples ({LLAMA_EXAMPLE_FINETUNE}));
3492
+
3493
+ #endif
3426
3494
return ctx_arg;
3427
3495
}
0 commit comments