summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2024-01-11 22:43:05 +0200
committerGeorgi Gerganov <ggerganov@gmail.com>2024-01-11 22:43:05 +0200
commit3ca63b4538dfc78aaec88cd2c3e3f8417c1924e3 (patch)
tree741167ae638864d1943d72adc9fd72b249f99437
parentb0377875488b33f7114138687d828da1de61775d (diff)
main : disable token count by default (#4874)
-rw-r--r--common/common.cpp6
-rw-r--r--common/common.h2
-rw-r--r--examples/main/main.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/common/common.cpp b/common/common.cpp
index bfcd6d4d..287e8bd5 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -630,7 +630,7 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) {
break;
}
params.ppl_stride = std::stoi(argv[i]);
- } else if (arg == "-stc" || arg == "--show_token_count") {
+ } else if (arg == "-stc" || arg == "--show-token-count") {
if (++i >= argc) {
invalid_param = true;
break;
@@ -950,8 +950,8 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
printf(" --override-kv KEY=TYPE:VALUE\n");
printf(" advanced option to override model metadata by key. may be specified multiple times.\n");
printf(" types: int, float, bool. example: --override-kv tokenizer.ggml.add_bos_token=bool:false\n");
- printf(" -stc N --show_token_count N\n");
- printf(" show consumed tokens every N tokens\n");
+ printf(" -stc N --show-token-count N\n");
+ printf(" show consumed tokens every N tokens (default: %d)\n", params.token_interval);
printf("\n");
#ifndef LOG_DISABLE_LOGS
log_print_usage();
diff --git a/common/common.h b/common/common.h
index a295e88b..82d23cf5 100644
--- a/common/common.h
+++ b/common/common.h
@@ -64,7 +64,7 @@ struct gpt_params {
int32_t n_beams = 0; // if non-zero then use beam search of given width.
int32_t grp_attn_n = 1; // group-attention factor
int32_t grp_attn_w = 512; // group-attention width
- int32_t token_interval = 512; // show token count every 512 tokens
+ int32_t token_interval = -1; // show token count every 512 tokens (-1 = disabled)
float rope_freq_base = 0.0f; // RoPE base frequency
float rope_freq_scale = 0.0f; // RoPE frequency scaling factor
float yarn_ext_factor = -1.0f; // YaRN extrapolation mix factor
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 1f35febb..6953d107 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -651,8 +651,8 @@ int main(int argc, char ** argv) {
LOG("n_past = %d\n", n_past);
// Display total tokens alongside total time
- if (n_past % params.token_interval == 0) {
- printf("\n\033[31mTokens consumed so far = %d / %d \033[0m\n", n_past, n_ctx);
+ if (params.token_interval > 0 && n_past % params.token_interval == 0) {
+ LOG_TEE("\n\033[31mTokens consumed so far = %d / %d \033[0m\n", n_past, n_ctx);
}
}