Skip to content

Commit

Permalink
no need for file
Browse files Browse the repository at this point in the history
  • Loading branch information
grencez committed Jul 25, 2024
1 parent d92752f commit 3545512
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 0 additions & 5 deletions example/prompt/assistant_llama/priming.txt

This file was deleted.

3 changes: 0 additions & 3 deletions example/prompt/assistant_llama/rolling.txt

This file was deleted.

16 changes: 14 additions & 2 deletions example/prompt/assistant_llama/setting.sxpb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions src/chat/opt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/chat/opt_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3545512

Please sign in to comment.