From ab73745993d05adb229988015812a8ef509771d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pazdiora?= Date: Tue, 11 Apr 2023 23:08:25 +0200 Subject: [PATCH] update formatting --- examples/common.cpp | 2 +- examples/common.h | 2 +- examples/main/main.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/common.cpp b/examples/common.cpp index cb7b583d5..57b4854e1 100644 --- a/examples/common.cpp +++ b/examples/common.cpp @@ -32,7 +32,7 @@ extern "C" __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int #define CP_UTF8 65001 #endif -void split_args(std::string args_string, std::vector & output_args) +void split_args(std::string args_string, std::vector & output_args) { std::string current_arg = ""; bool in_quotes = false; diff --git a/examples/common.h b/examples/common.h index ae3401b8a..df8e4c6cc 100644 --- a/examples/common.h +++ b/examples/common.h @@ -40,7 +40,7 @@ struct gpt_params { std::vector antiprompt; // string upon seeing which more user input is prompted std::vector stopprompt; // string upon seeing which more user input is prompted (without adding instruct prefixes and suffixes) - + bool rm_trailing_space_workaround = false; // workaround for removing trailing space from reverse/stop prompts bool memory_f16 = true; // use f16 instead of f32 for memory kv diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 9252ef3bb..68b4b2840 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -420,7 +420,7 @@ int main(int argc, char ** argv) { } } - if (n_past > 0 && is_interacting) + if (n_past > 0 && is_interacting) { std::string buffer; if (!params.clean_interface && !params.instruct_prefix.empty() && !antiprompt.any) { @@ -430,10 +430,10 @@ int main(int argc, char ** argv) { printf("%s", llama_token_to_str(ctx, inp_pfx[i])); } fflush(stdout); - } + } if (params.rm_trailing_space_workaround) { // add only if not stopprompt (as stopprompt could be used to pause - // assistant and then continue without input - adding back trailing + // assistant and then continue without input - adding back trailing // space may mess it up.) if (!antiprompt.is_stop_prompt && antiprompt.any && antiprompt.trailing_space) { // add back removed trailing space to buffer(workaround)