update formatting

This commit is contained in:
Tomáš Pazdiora 2023-04-11 23:08:25 +02:00
parent c4c7ead0bd
commit ab73745993
3 changed files with 5 additions and 5 deletions

View file

@ -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<std::string> & output_args)
void split_args(std::string args_string, std::vector<std::string> & output_args)
{
std::string current_arg = "";
bool in_quotes = false;

View file

@ -40,7 +40,7 @@ struct gpt_params {
std::vector<std::string> antiprompt; // string upon seeing which more user input is prompted
std::vector<std::string> 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

View file

@ -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)