summaryrefslogtreecommitdiff
path: root/examples/main
diff options
context:
space:
mode:
authorvvhg1 <94630311+vvhg1@users.noreply.github.com>2023-10-22 20:09:51 +0200
committerGitHub <noreply@github.com>2023-10-22 21:09:51 +0300
commitd3956aea53369455008159cc405ed4c496976692 (patch)
treea081c76c66362d64fc28efa422bf97f58af2a244 /examples/main
parent22c69a27945e7acf9690dd3210d316f22182751c (diff)
main : escape prompt for cfg_negative_prompt and consecutive inputs in main with interactive (#3623)
* infill tokens correction * serverinfill tokens correction * removing any leading whitespace from infill suffix and removing leeading space token from suffix when params.escape * removing any leading whitespace from infill suffix and removing leeading space token from suffix when params.escape * only rm when params.escape, rm space if possible which is added back or rm added space token * only rm when params.escape, rm space if possible which is added back or rm added space token * Revert "only rm when params.escape, rm space if possible which is added back or rm added space token" This reverts commit 63ba0b621f21077c0e3bc6ba6a327534123cb738. * fix interactive prompt escaping and fix server infill leading space handling * rm unnecessary bool check * process escapes for neg prompt and interactive consec prompts * removed unneccessary static string escape
Diffstat (limited to 'examples/main')
-rw-r--r--examples/main/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index db5309af..2621bd53 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);