Skip to content

Commit

Permalink
only rm when params.escape, rm space if possible which is added back …
Browse files Browse the repository at this point in the history
…or rm added space token
  • Loading branch information
vvhg1 committed Oct 7, 2023
1 parent 0526560 commit 63ba0b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/infill/infill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<llama_token> embd_inp;
std::vector<llama_token> inp_pfx = ::llama_tokenize(ctx, params.input_prefix, false);
std::vector<llama_token> inp_sfx = ::llama_tokenize(ctx, params.input_suffix, false);
Expand Down

0 comments on commit 63ba0b6

Please sign in to comment.