From 4d7c14be73bc220c359d1f79cb938a61cb329e18 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 20 Nov 2023 22:35:45 +0800 Subject: [PATCH] fix stop seq escaping newline --- gpttype_adapter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index 7c81ae53e3e00..b461ecfde4b59 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -1950,7 +1950,9 @@ generation_outputs gpttype_generate(const generation_inputs inputs, generation_o remaining_tokens = 0; if(debugmode!=-1) { - printf("\n(Stop sequence triggered: <%s>)", matched.c_str()); + auto match_clean = matched; + replace_all(match_clean, "\n", "\\n"); + printf("\n(Stop sequence triggered: %s)", match_clean.c_str()); } last_stop_reason = stop_reason::CUSTOM_STOPPER; break;