@@ -853,6 +853,20 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
853853 }
854854 }
855855 ).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}));
856870 add_opt (common_arg (
857871 {" --in-file" }, " FNAME" ,
858872 " an input file (repeat to specify multiple files)" ,
@@ -1875,7 +1889,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
18751889 [](common_params & params, const std::string & value) {
18761890 params.out_file = value;
18771891 }
1878- ).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 }));
18791893 add_opt (common_arg (
18801894 {" -ofreq" , " --output-frequency" }, " N" ,
18811895 string_format (" output the imatrix every N iterations (default: %d)" , params.n_out_freq ),
0 commit comments