-
Notifications
You must be signed in to change notification settings - Fork 14.2k
escaping prompt for cfg_negative_prompt and consecutive prompts in main with interactive #3623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dfeda32
8bd24b2
6796e74
377be2f
b4046aa
0526560
63ba0b6
003c15b
fc01dc0
c3a7f84
b1b6bef
4a21468
d9dae93
141329f
3517729
9b608da
8eef958
ee652b2
52a7767
02ac367
f0d3971
97d67e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -767,6 +767,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); | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we not also want to keep this to escape the new input?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to - the model will not generate unescaped stuff
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would that not result in a situation where we escape the initial prompt but not the following prompts in interactive mode?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vvhg1 While enabling escapes for interactive user input would allow "multiline" input via "\n", it would prevent user from writing "\n" literally, making it impossible to do things like copy-pasting code snippets etc.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @staviq I see your point. What I don't yet understand is, why would we want to treat the initial prompt differently than subsequential prompts?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, wait - I think I was wrong. Let me check this again later, but we might want to keep this escape
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I agree we should keep this escape as well
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, should all be ready to merge |
||
|
|
||
| const auto line_pfx = ::llama_tokenize(ctx, params.input_prefix, false, true); | ||
| const auto line_inp = ::llama_tokenize(ctx, buffer, false, false); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep only this line from this PR and we can merge.
All other changes are not necessary