Skip to content

Commit

Permalink
chore(maint): ANSI font in the main example (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
PABannier authored Nov 16, 2024
1 parent eacac27 commit b953e58
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions examples/main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#include <string>
#include <iostream>
#include <tuple>

#include "bark.h"
#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);
Expand All @@ -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();
Expand Down

0 comments on commit b953e58

Please sign in to comment.