diff --git a/example/prompt/assistant_llama/priming.txt b/example/prompt/assistant_llama/priming.txt deleted file mode 100644 index 7b1f22c..0000000 --- a/example/prompt/assistant_llama/priming.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|start_header_id|>system<|end_header_id|> - -Cutting Knowledge Date: December 2023 - -You are a helpful assistant who is perfect at math except for 9+10, which you know to equal 21. The same is not true for 10+9, which is 19 obviously.<|eot_id|> diff --git a/example/prompt/assistant_llama/rolling.txt b/example/prompt/assistant_llama/rolling.txt deleted file mode 100644 index 587ca04..0000000 --- a/example/prompt/assistant_llama/rolling.txt +++ /dev/null @@ -1,3 +0,0 @@ -<|start_header_id|>user<|end_header_id|> - -Hello! What's Red 21 got in it?<|eot_id|> diff --git a/example/prompt/assistant_llama/setting.sxpb b/example/prompt/assistant_llama/setting.sxpb index 159e8c5..4cfa55a 100644 --- a/example/prompt/assistant_llama/setting.sxpb +++ b/example/prompt/assistant_llama/setting.sxpb @@ -16,8 +16,20 @@ ) ) -(x_priming "priming.txt") -(x_rolling "rolling.txt") +(priming_text """\ +<|start_header_id|>system<|end_header_id|> + +Cutting Knowledge Date: December 2023 +Today Date: July 2024 + +You are a helpful assistant.<|eot_id|>\ +""") +(rolling_text """\ +<|start_header_id|>user<|end_header_id|> + +Hello!<|eot_id|>\ +""") + (o_rolling "../../../bld/example/prompt/assistant_llama.txt") ; No starting space. diff --git a/src/chat/opt.cc b/src/chat/opt.cc index 160282c..ceae61b 100644 --- a/src/chat/opt.cc +++ b/src/chat/opt.cc @@ -454,6 +454,9 @@ slurp_sxpb_options_close_FildeshX( } } } + if (lone_subfield_at_FildeshSxpb_to_str(&s, sxpb, top_it, "priming_text")) { + opt.priming_prompt += s; + } if (lone_subfield_at_FildeshSxpb_to_str(&s, sxpb, top_it, "x_answer")) { const std::string answer_filename = fildesh::sibling_pathname( @@ -482,6 +485,9 @@ slurp_sxpb_options_close_FildeshX( opt.mmap_on = false; // mmap() is incompatible. } + if (lone_subfield_at_FildeshSxpb_to_str(&s, sxpb, top_it, "rolling_text")) { + opt.rolling_prompt += s; + } if (lone_subfield_at_FildeshSxpb_to_str(&s, sxpb, top_it, "x_rolling")) { FildeshX* rolling_in = open_sibling_FildeshXF(sxpb_filename.c_str(), s); parse_rolling_prompt(rolling_in, opt); diff --git a/src/chat/opt_schema.cc b/src/chat/opt_schema.cc index 20ca537..84fbe24 100644 --- a/src/chat/opt_schema.cc +++ b/src/chat/opt_schema.cc @@ -67,6 +67,8 @@ rendezllama::options_sxproto_schema() {"x_answer", FILL_FildeshSxprotoField_STRING(1, FILENAME_MAX)}, {"x_priming", FILL_FildeshSxprotoField_STRING(1, FILENAME_MAX)}, {"x_rolling", FILL_FildeshSxprotoField_STRING(1, FILENAME_MAX)}, + {"priming_text", FILL_FildeshSxprotoField_STRING(1, INT_MAX)}, + {"rolling_text", FILL_FildeshSxprotoField_STRING(1, INT_MAX)}, }; DECLARE_TOPLEVEL_FildeshSxprotoField(schema, toplevel_fields); lone_toplevel_initialization_FildeshSxprotoField(schema);