From b953e58527b0e633c1a56ec5109f76ee0c91282a Mon Sep 17 00:00:00 2001 From: PAB Date: Sat, 16 Nov 2024 13:01:45 +0100 Subject: [PATCH] chore(maint): ANSI font in the `main` example (#205) --- examples/main/main.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index f25b22d..8427380 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -5,6 +6,11 @@ #include "common.h" #include "ggml.h" + +const std::string DARK_GREEN = "\033[32;2m"; +const std::string RESET = "\033[0m"; + + void bark_print_progress_callback(struct bark_context *bctx, enum bark_encoding_step step, int progress, void *user_data) { if (step == bark_encoding_step::SEMANTIC) { printf("\rGenerating semantic tokens... %d%%", progress); @@ -28,14 +34,16 @@ int main(int argc, char **argv) { return 1; } - std::cout << R"( _ _ )" << "\n" - << R"(| | | | )" << "\n" - << R"(| |__ __ _ _ __ | | __ ___ _ __ _ __ )" << "\n" - << R"(| '_ \ / _` || '__|| |/ / / __|| '_ \ | '_ \ )" << "\n" - << R"(| |_) || (_| || | | < _ | (__ | |_) || |_) |)" << "\n" - << R"(|_.__/ \__,_||_| |_|\_\(_) \___|| .__/ | .__/ )" << "\n" - << R"( | | | | )" << "\n" - << R"( |_| |_| )" << "\n"; + std::cout << DARK_GREEN; + std::cout << "\n"; + + std::cout << R"(██████╗ █████╗ ██████╗ ██╗ ██╗ ██████╗██████╗ ██████╗ )" << "\n" + << R"(██╔══██╗██╔══██╗██╔══██╗██║ ██╔╝ ██╔════╝██╔══██╗██╔══██╗)" << "\n" + << R"(██████╔╝███████║██████╔╝█████╔╝ ██║ ██████╔╝██████╔╝)" << "\n" + << R"(██╔══██╗██╔══██║██╔══██╗██╔═██╗ ██║ ██╔═══╝ ██╔═══╝ )" << "\n" + << R"(██████╔╝██║ ██║██║ ██║██║ ██╗██╗╚██████╗██║ ██║ )" << "\n" + << R"(╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝╚═╝ ╚═╝ )" << "\n" + << RESET << "\n"; // initialize bark context struct bark_context_params ctx_params = bark_context_default_params();