From e9cb3b336d155cf900f8860cff3b8d5974c83a4a Mon Sep 17 00:00:00 2001 From: ngxson Date: Tue, 11 Jun 2024 22:09:14 +0200 Subject: [PATCH] fix .editorconfig --- .editorconfig | 3 +++ .../control-vector-generator/control-vector-generator.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 16d16b3b5..ee6f60e79 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,3 +26,6 @@ indent_size = 2 [examples/llama.swiftui/llama.swiftui.xcodeproj/*] indent_style = tab + +[examples/control-vector-generator/*.txt] +insert_final_newline = unset diff --git a/examples/control-vector-generator/control-vector-generator.cpp b/examples/control-vector-generator/control-vector-generator.cpp index 69cde8f04..3ca2c5305 100644 --- a/examples/control-vector-generator/control-vector-generator.cpp +++ b/examples/control-vector-generator/control-vector-generator.cpp @@ -144,7 +144,7 @@ struct callback_data { return diff_filtered; } - // we don't implement destructor, because we want to reuse callback_data. we just want to free the tensors + // we don't implement destructor, because we want to reuse callback_data. we just want to free the tensors void reset() { for (auto ptr : v_pos) free(ptr->data); for (auto ptr : v_neg) free(ptr->data); @@ -430,7 +430,7 @@ static int ctrlvec_params_parse(int argc, char ** argv, ctrl_params & params) { catch (const std::invalid_argument & ex) { fprintf(stderr, "%s\n", ex.what()); print_usage(argv[0]); - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } return skipme; } @@ -495,7 +495,7 @@ static void export_gguf(const std::vector & v_ctrl, const printf("Added tensor: %s\n", v_ctrl[i]->name); } - printf("Writing file...\n"); + printf("Writing file...\n"); gguf_write_to_file(ctx, fname.c_str(), false); @@ -603,7 +603,7 @@ int main(int argc, char ** argv) { cb_data.n_layers = n_layers; cb_data.n_tokens = t.max_seq_len; - printf("Evaluating prompt[%ld/%ld]: \"%s\" - \"%s\" (%ld tokens)\n", + printf("Evaluating prompt[%ld/%ld]: \"%s\" - \"%s\" (%ld tokens)\n", i+1, cparams.positive_entries.size(), tokens_to_str(ctx, t.tokens_pos.cbegin(), t.tokens_pos.cend()).c_str(), tokens_to_str(ctx, t.tokens_neg.cbegin(), t.tokens_neg.cend()).c_str(),