File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -853,6 +853,20 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
853
853
}
854
854
}
855
855
).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}));
856
870
add_opt (common_arg (
857
871
{" --in-file" }, " FNAME" ,
858
872
" an input file (repeat to specify multiple files)" ,
You can’t perform that action at this time.
0 commit comments