From 63ba0b621f21077c0e3bc6ba6a327534123cb738 Mon Sep 17 00:00:00 2001 From: vvhg1 Date: Sat, 7 Oct 2023 09:22:36 +0200 Subject: [PATCH] only rm when params.escape, rm space if possible which is added back or rm added space token --- examples/infill/infill.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/infill/infill.cpp b/examples/infill/infill.cpp index 47ece81c6..9d97090ca 100644 --- a/examples/infill/infill.cpp +++ b/examples/infill/infill.cpp @@ -234,10 +234,11 @@ int main(int argc, char ** argv) { LOG("add_bos: %d\n", add_bos); bool suff_rm_leading_spc = params.escape; - if (suff_rm_leading_spc && params.input_suffix.find_first_of(" ") == 0 && params.input_suffix.size() > 1) { - params.input_suffix.erase(0, 1); - suff_rm_leading_spc = false; - } + // if (suff_rm_leading_spc && params.input_suffix.find_first_of(" ") == 0 && params.input_suffix.size() > 1) { + // params.input_suffix.erase(0, 1); + // suff_rm_leading_spc = false; + // } + suff_rm_leading_spc = true; std::vector embd_inp; std::vector inp_pfx = ::llama_tokenize(ctx, params.input_prefix, false); std::vector inp_sfx = ::llama_tokenize(ctx, params.input_suffix, false);