You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm baffled that others haven't brought up this issue, which may mean I have overlooked or misunderstood something.
I frequently ask llama.cpp about code I'm working on, so I paste it to the terminal running main in interactive mode.
Whenever there are backslashes, console.cpp treats that as end of input and begins responding.
I don't want that, of course.
I modified a march/april pull of llama.cpp too allow me to paste code or other text with backslashes. Now it only ends input if the backslash is on it's own line... If I have the right version here...
bool has_more = multiline_input; bool has_more = multiline_input;
if (is_special_char) { if (is_special_char) {
replace_last(' '); replace_last(' ');
pop_cursor(); pop_cursor();
>
char last = line.back(); char last = line.back();
line.pop_back(); line.pop_back();
if (last == '\\') { | if (last == '\\') {
line += '\n'; line += '\n';
fputc('\n', out); fputc('\n', out);
if (line.length() <= 2){ // only backslashes | has_more = !has_more;
has_more = !has_more; <
fputc('\n', out); <
} else { <
fputc('\\', out); // pass on the back <
fputc('\n', out); <
} <
} else { } else {
// llama will just eat the single space, it w // llama will just eat the single space, it w
if (line.length() == 1 && line.back() == ' ') if (line.length() == 1 && line.back() == ' ')
line.clear(); line.clear();
pop_cursor(); pop_cursor();
} }
has_more = false; has_more = false;
} }
} else { } else {
if (end_of_stream) { if (end_of_stream) {
has_more = false; has_more = false;
} else { } else {
line += '\n'; line += '\n';
fputc('\n', out); fputc('\n', out);
} }
} }
I'd write a PR, however: the fact that nobody else has complained inability to paste code with backslashes, suggests I might be using llama.cpp wrong.
Why isn't anyone complaining about this?
Would you like to review my fix?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm baffled that others haven't brought up this issue, which may mean I have overlooked or misunderstood something.
I frequently ask llama.cpp about code I'm working on, so I paste it to the terminal running main in interactive mode.
Whenever there are backslashes, console.cpp treats that as end of input and begins responding.
I don't want that, of course.
I modified a march/april pull of llama.cpp too allow me to paste code or other text with backslashes. Now it only ends input if the backslash is on it's own line... If I have the right version here...
I'd write a PR, however: the fact that nobody else has complained inability to paste code with backslashes, suggests I might be using llama.cpp wrong.
Why isn't anyone complaining about this?
Would you like to review my fix?
Beta Was this translation helpful? Give feedback.
All reactions