From 1cf0b0927396dd33fd68550ee2eb644d77fb6e00 Mon Sep 17 00:00:00 2001 From: Bartosz Podkanowicz Date: Thu, 9 Nov 2023 21:02:59 +0100 Subject: [PATCH] erase flushing stderr, changes in spaces --- examples/contrastive/contrastive.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/contrastive/contrastive.cpp b/examples/contrastive/contrastive.cpp index 3e52e779b..83610dcfe 100644 --- a/examples/contrastive/contrastive.cpp +++ b/examples/contrastive/contrastive.cpp @@ -31,11 +31,11 @@ int main(int argc, char ** argv) { float alpha = 0.1; float beta = 0.5; - if(argc >= 5){ + if (argc >= 5) { alpha = std::stof(argv[4]); } - if(argc >= 6){ + if (argc >= 6) { beta = std::stof(argv[5]); } @@ -117,8 +117,6 @@ int main(int argc, char ** argv) { fprintf(stderr, "%s", llama_token_to_piece(ctx_expert, id).c_str()); } - fflush(stderr); - // create a llama_batch with size 512 // we use this object to submit token data for decoding @@ -160,7 +158,7 @@ int main(int argc, char ** argv) { for (llama_token token_id = 0; token_id < n_vocab; token_id++) { float cd_logit = std::numeric_limits::lowest(); - if(logits_expert[token_id] > alpha){ + if (logits_expert[token_id] > alpha) { cd_logit = (1+beta)*logits_expert[token_id] - beta*logits_amateur[token_id]; } candidates.emplace_back(llama_token_data{ token_id, cd_logit, 0.0f }); @@ -178,7 +176,6 @@ int main(int argc, char ** argv) { } LOG_TEE("%s", llama_token_to_piece(ctx_expert, new_token_id_expert).c_str()); - fflush(stdout); // prepare the next batch llama_batch_clear(batch);