@@ -764,7 +764,11 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
764764 ).set_env (" LLAMA_ARG_CTX_SIZE" ));
765765 add_opt (common_arg (
766766 {" -n" , " --predict" , " --n-predict" }, " N" ,
767- string_format (" number of tokens to predict (default: %d, -1 = infinity, -2 = until context filled)" , params.n_predict ),
767+ string_format (
768+ ex == LLAMA_EXAMPLE_MAIN || ex == LLAMA_EXAMPLE_INFILL
769+ ? " number of tokens to predict (default: %d, -1 = infinity, -2 = until context filled)"
770+ : " number of tokens to predict (default: %d, -1 = infinity)" ,
771+ params.n_predict ),
768772 [](common_params & params, int value) {
769773 params.n_predict = value;
770774 }
@@ -849,6 +853,20 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
849853 }
850854 }
851855 ).set_excludes ({LLAMA_EXAMPLE_SERVER}));
856+ add_opt (common_arg (
857+ {" -sysf" , " --system-prompt-file" }, " FNAME" ,
858+ " a file containing the system prompt (default: none)" ,
859+ [](common_params & params, const std::string & value) {
860+ std::ifstream file (value);
861+ if (!file) {
862+ throw std::runtime_error (string_format (" error: failed to open file '%s'\n " , value.c_str ()));
863+ }
864+ std::copy (std::istreambuf_iterator<char >(file), std::istreambuf_iterator<char >(), back_inserter (params.system_prompt ));
865+ if (!params.system_prompt .empty () && params.system_prompt .back () == ' \n ' ) {
866+ params.system_prompt .pop_back ();
867+ }
868+ }
869+ ).set_examples ({LLAMA_EXAMPLE_MAIN}));
852870 add_opt (common_arg (
853871 {" --in-file" }, " FNAME" ,
854872 " an input file (repeat to specify multiple files)" ,
@@ -1871,7 +1889,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
18711889 [](common_params & params, const std::string & value) {
18721890 params.out_file = value;
18731891 }
1874- ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_CVECTOR_GENERATOR, LLAMA_EXAMPLE_EXPORT_LORA}));
1892+ ).set_examples ({LLAMA_EXAMPLE_IMATRIX, LLAMA_EXAMPLE_CVECTOR_GENERATOR, LLAMA_EXAMPLE_EXPORT_LORA, LLAMA_EXAMPLE_TTS }));
18751893 add_opt (common_arg (
18761894 {" -ofreq" , " --output-frequency" }, " N" ,
18771895 string_format (" output the imatrix every N iterations (default: %d)" , params.n_out_freq ),
0 commit comments