summaryrefslogtreecommitdiff
path: root/common/common.h
diff options
context:
space:
mode:
authorJustine Tunney <jtunney@mozilla.com>2024-05-25 05:04:03 -0400
committerGitHub <noreply@github.com>2024-05-25 19:04:03 +1000
commit00c63907931bb08a0ed2b7e38cf44dd290143cb9 (patch)
treec2248d26ae5d25160594523b562bb2481fb1c87a /common/common.h
parentfaa0e6979a11dcb731e9d778ad42ceaa0302015e (diff)
main : don't print special tokens with --grammar (#6923)
* main : don't print special tokens with --grammar The CLI interface was recently changed to print special control tokens like the </s> stop message one. This token shouldn't be printed if the grammar flag was passed, unless the grammar specifies it, because that breaks shell-scriptability. * main: use seperate stream for control characters * main: use dprintf and add --ctrl-token-no-out and --ctrl-token-fd-out * main: dprintf isn't part of the IEEE POSIX standard. Just use write(). * main: remove --ctrl-token-fd-out in favor for fcntl() based detection * common.cpp: accidentally removed --interactive-first * main: only merge stdout and control token if not in conversation or grammar mode * main: rejig control token descriptor handling * main: must check pipe status on very top of program * main: renamed --no-special from --ctrl-token-no-out and other refactoring * main: refactor ctrl_token_no_out --> no_special * llama: rename llama_token_is_control_token() to llama_token_is_control() * main: remove special token file descriptor feature (#5) --------- Co-authored-by: Brian <mofosyne@gmail.com>
Diffstat (limited to 'common/common.h')
-rw-r--r--common/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h
index f68f3c29..5388f6b6 100644
--- a/common/common.h
+++ b/common/common.h
@@ -146,6 +146,7 @@ struct gpt_params {
bool use_color = false; // use color to distinguish generations and inputs
bool interactive = false; // interactive mode
bool interactive_specials = false; // whether to allow special tokens from user, during interactive mode
+ bool no_special = false; // disable control token output
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