]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : avoid fprintf in favor of LLAMA_LOG (#3538)
authorGeorgi Gerganov <redacted>
Tue, 17 Oct 2023 19:34:26 +0000 (22:34 +0300)
committerGeorgi Gerganov <redacted>
Tue, 17 Oct 2023 19:34:26 +0000 (22:34 +0300)
examples/main/main.cpp
llama.cpp

index a5fb65548ff4f7003b14975a54b21d8291f2e955..7313d06a0942facf2b586d981e51cf8cc4d92c5c 100644 (file)
@@ -799,7 +799,7 @@ int main(int argc, char ** argv) {
                     }
 
                     const auto line_pfx = ::llama_tokenize(ctx, params.input_prefix, false, true);
-                    const auto line_inp = ::llama_tokenize(ctx, buffer, false, false);
+                    const auto line_inp = ::llama_tokenize(ctx, buffer,              false, false);
                     const auto line_sfx = ::llama_tokenize(ctx, params.input_suffix, false, true);
                     LOG("input tokens: %s\n", LOG_TOKENS_TOSTR_PRETTY(ctx, line_inp));
 
index 82b7638ae7ce1af6b007ec17db725ab0b7161aa9..37df88779ab35f57c9da4a9588917a21ae4930f4 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -2327,13 +2327,13 @@ static void llm_load_vocab(
         }
 
         if (special_tokens_definition_mismatch || special_tokens_count_from_verification != special_tokens_count_by_type) {
-            fprintf(stderr, "%s: warning: Mismatch in special tokens definition ( %u/%zu vs %u/%zu ).\n",
+            LLAMA_LOG_WARN("%s: mismatch in special tokens definition ( %u/%zu vs %u/%zu ).\n",
                 __func__,
                 special_tokens_count_from_verification, vocab.id_to_token.size(),
                 special_tokens_count_by_type, vocab.id_to_token.size()
             );
         } else {
-            fprintf(stderr, "%s: Special tokens definition check successful ( %u/%zu ).\n",
+            LLAMA_LOG_INFO("%s: special tokens definition check successful ( %u/%zu ).\n",
                 __func__,
                 special_tokens_count_from_verification, vocab.id_to_token.size()
             );