From 886f4eed7948f494e3da1d48d4f6f844e2f9a2c2 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Thu, 10 Aug 2023 22:01:33 +0800 Subject: [PATCH] updated lite, up ver, remove bell --- gpttype_adapter.cpp | 11 +++++++++-- klite.embd | 13 ++++++++----- koboldcpp.py | 3 ++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index a2283269c..dcb7558f2 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -334,6 +334,13 @@ static std::string FileFormatTokenizeID(int id, FileFormat file_format) } } +static std::string RemoveBell(const std::string & input) //removes the bell character +{ + std::string word2; + std::remove_copy(input.begin(), input.end(), std::back_inserter(word2), '\a'); + return word2; +} + ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in_file_format) { ggml_time_init(); @@ -1183,7 +1190,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs, generation_o } ::utreplace(tmp, "\n", "\\n"); outstr += tmp; - printf("%s\n\n", outstr.c_str()); + printf("%s\n\n", RemoveBell(outstr).c_str()); } while (remaining_tokens > 0) @@ -1446,7 +1453,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs, generation_o firstloop = false; std::string tokenizedstr = FileFormatTokenizeID(pick.id, file_format); ::utreplace(tokenizedstr, "\n", "\\n"); - printf("(%s %.2f%%)", tokenizedstr.c_str(), pick.p*100); + printf("(%s %.2f%%)", RemoveBell(tokenizedstr).c_str(), pick.p*100); } printf("]\n"); } diff --git a/klite.embd b/klite.embd index 153b4af7d..caa067308 100644 --- a/klite.embd +++ b/klite.embd @@ -1,6 +1,6 @@