diff options
author | Dawid Potocki <github@dawidpotocki.com> | 2024-05-09 02:32:32 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 17:32:32 +0300 |
commit | 83330d8cd6491e53e1aca4c5dfc47e039b3c04ff (patch) | |
tree | 72b80a600fbaf82867c8f14729f2d58e644bcdc3 /common | |
parent | 465263d0cf1e8f8bc41948332dbd009d27a68590 (diff) |
main : add --conversation / -cnv flag (#7108)
Diffstat (limited to 'common')
-rw-r--r-- | common/common.cpp | 5 | ||||
-rw-r--r-- | common/common.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/common/common.cpp b/common/common.cpp index 467fb014..4a9da284 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -911,6 +911,10 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa params.instruct = true; return true; } + if (arg == "-cnv" || arg == "--conversation") { + params.conversation = true; + return true; + } if (arg == "-cml" || arg == "--chatml") { params.chatml = true; return true; @@ -1417,6 +1421,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) { printf(" --version show version and build info\n"); printf(" -i, --interactive run in interactive mode\n"); printf(" --interactive-first run in interactive mode and wait for input right away\n"); + printf(" -cnv, --conversation run in conversation mode (does not print special tokens and suffix/prefix)\n"); printf(" -ins, --instruct run in instruction mode (use with Alpaca models)\n"); printf(" -cml, --chatml run in chatml mode (use with ChatML-compatible models)\n"); printf(" --multiline-input allows you to write or paste multiple lines without ending each in '\\'\n"); diff --git a/common/common.h b/common/common.h index 9252a4b6..6f00a2cc 100644 --- a/common/common.h +++ b/common/common.h @@ -140,6 +140,7 @@ struct gpt_params { bool random_prompt = false; // do not randomize prompt if none provided bool use_color = false; // use color to distinguish generations and inputs bool interactive = false; // interactive mode + bool conversation = false; // conversation mode (does not print special tokens and suffix/prefix) bool chatml = false; // chatml mode (used for models trained on chatml syntax) bool prompt_cache_all = false; // save user input and generations to prompt cache bool prompt_cache_ro = false; // open the prompt cache read-only and do not update it |