diff --git a/common/common.cpp b/common/common.cpp index 2ef902bd504c4..bbd1518ca2934 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -632,6 +632,7 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) { process_escapes(params.prompt); process_escapes(params.input_prefix); process_escapes(params.input_suffix); + process_escapes(sparams.cfg_negative_prompt); for (auto & antiprompt : params.antiprompt) { process_escapes(antiprompt); } diff --git a/examples/main/main.cpp b/examples/main/main.cpp index db5309afeb117..2621bd539875f 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -761,6 +761,9 @@ int main(int argc, char ** argv) { n_consumed = embd_inp.size(); embd_inp.insert(embd_inp.end(), inp_pfx.begin(), inp_pfx.end()); } + if (params.escape) { + process_escapes(buffer); + } const auto line_pfx = ::llama_tokenize(ctx, params.input_prefix, false, true); const auto line_inp = ::llama_tokenize(ctx, buffer, false, false);