summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBrian <mofosyne@gmail.com>2024-05-27 00:10:17 +1000
committerGitHub <noreply@github.com>2024-05-27 00:10:17 +1000
commitd298382ad977ec89c8de7b57459b9d7965d2c272 (patch)
treec1685e6ff556aac2961b73748e74c2d65a92ff5a /examples
parent32a28217f475119926c603341e8273b26932b56a (diff)
main: replace --no-special with --special (#7534)
This also flips the default behavior of the output to not include control token by default.
Diffstat (limited to 'examples')
-rw-r--r--examples/main/main.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index ac35772f..44949ba8 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -740,16 +740,10 @@ int main(int argc, char ** argv) {
// display text
if (input_echo && display) {
for (auto id : embd) {
- const std::string token_str = llama_token_to_piece(ctx, id);
+ const std::string token_str = llama_token_to_piece(ctx, id, params.special);
// Console/Stream Output
- if (!llama_token_is_control(llama_get_model(ctx), id)) {
- // Stream Output Token To Standard Output
- fprintf(stdout, "%s", token_str.c_str());
- } else if (!params.no_special && !params.conversation) {
- // Stream Control Token To Standard Output Stream
- fprintf(stdout, "%s", token_str.c_str());
- }
+ fprintf(stdout, "%s", token_str.c_str());
// Record Displayed Tokens To Log
// Note: Generated tokens are created one by one hence this check