Skip to content

Commit 938b7c2

Browse files
newTomasggerganov
authored andcommitted
fix ggml-org#1224 reverse prompt and multi line (ggml-org#1297)
* fix reverse prompt and multi line * Code Formatting Co-authored-by: Georgi Gerganov <[email protected]> --------- Co-authored-by: Georgi Gerganov <[email protected]>
1 parent 981d71b commit 938b7c2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/main/main.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,14 @@ int main(int argc, char ** argv) {
551551
return 0;
552552
}
553553
#endif
554-
if (line.empty() || line.back() != '\\') {
555-
another_line = false;
556-
} else {
557-
line.pop_back(); // Remove the continue character
554+
if (!line.empty()) {
555+
if (line.back() == '\\') {
556+
line.pop_back(); // Remove the continue character
557+
} else {
558+
another_line = false;
559+
}
560+
buffer += line + '\n'; // Append the line to the result
558561
}
559-
buffer += line + '\n'; // Append the line to the result
560562
} while (another_line);
561563

562564
// done taking input, reset color

0 commit comments

Comments
 (0)