This commit is contained in:
Yann Follet 2025-02-05 22:53:54 -05:00 committed by GitHub
commit 249c5bdfe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -2104,7 +2104,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
));
add_opt(common_arg(
{"-lv", "--verbosity", "--log-verbosity"}, "N",
"Set the verbosity threshold. Messages with a higher verbosity will be ignored.",
"Set the verbosity threshold. Messages with a higher verbosity will be ignored. (-lv -1 for token only, no EOS nor EOG message)",
[](common_params & params, int value) {
params.verbosity = value;
common_log_set_verbosity_thold(value);

View file

@ -86,6 +86,7 @@ void common_log_set_timestamps(struct common_log * log, bool timestamps)
} \
} while (0)
#define LOGTOKEN(...) LOG_TMPL(GGML_LOG_LEVEL_NONE, -1, __VA_ARGS__)
#define LOG(...) LOG_TMPL(GGML_LOG_LEVEL_NONE, 0, __VA_ARGS__)
#define LOGV(verbosity, ...) LOG_TMPL(GGML_LOG_LEVEL_NONE, verbosity, __VA_ARGS__)

View file

@ -706,7 +706,7 @@ int main(int argc, char ** argv) {
const std::string token_str = common_token_to_piece(ctx, id, params.special);
// Console/Stream Output
LOG("%s", token_str.c_str());
LOGTOKEN("%s", token_str.c_str());
// Record Displayed Tokens To Log
// Note: Generated tokens are created one by one hence this check