Support special tokens as reverse/anti prompt.
This commit is contained in:
parent
9731134296
commit
ef651247d0
1 changed files with 2 additions and 1 deletions
|
@ -760,7 +760,8 @@ int main(int argc, char ** argv) {
|
||||||
? last_output.length() - static_cast<size_t>(antiprompt.length() + extra_padding)
|
? last_output.length() - static_cast<size_t>(antiprompt.length() + extra_padding)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
if (last_output.find(antiprompt, search_start_pos) != std::string::npos) {
|
auto tmp = ::llama_tokenize(ctx, antiprompt, false, true);
|
||||||
|
if (last_output.find(antiprompt, search_start_pos) != std::string::npos || (tmp.size() == 1 && llama_sampling_last(ctx_sampling) == tmp[0])) {
|
||||||
if (params.interactive) {
|
if (params.interactive) {
|
||||||
is_interacting = true;
|
is_interacting = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue