diff --git a/activate.sh b/activate.sh index 479f604..630fd62 100644 --- a/activate.sh +++ b/activate.sh @@ -1,4 +1,4 @@ -export VIRTUAL_ENV_PROMPT="Xenith" +export VIRTUAL_ENV_PROMPT="\033[31mXenith\033[39m" alias Xenith='./bin/Xenith' if [ -z "${_OLD_VIRTUAL_PS1+x}" ]; then _OLD_VIRTUAL_PS1="$PS1" diff --git a/bin/Xenith b/bin/Xenith index 3509bc2..f70a2d5 100755 Binary files a/bin/Xenith and b/bin/Xenith differ diff --git a/main.cpp b/main.cpp index 1cc3fd8..45dd98c 100644 --- a/main.cpp +++ b/main.cpp @@ -371,6 +371,20 @@ int main(int argc, char** argv) { const std::string cmd = argv[1]; if (cmd == "-h" || cmd == "--help" || cmd == "help") { printf(HELP_TEXT); return 0; } + if (available_new_version()) { + const std::string TMP_FILE = "./tmp/remote_version.txt"; + std::ifstream tmp_file(TMP_FILE); + std::string remote_str = "0.0.0"; + if (tmp_file.is_open() && std::getline(tmp_file, remote_str)) { + tmp_file.close(); + } else { + std::cerr << "Ошибка чтения файла новой версии (Пожалуйста напишите о этом баге)" << std::endl; + return false; + } + std::cout << "Доступна новая версия \033[33m" << remote_str << "\033[39m\nВыполните \"Xenith update\" чтобы обновится до последней версии\n" << std::endl; + return 0; + } + Args a(argc, argv, 2); if (cmd == "new") return cmd_new(a); if (cmd == "train") return cmd_train(a); diff --git a/version.txt b/version.txt index 05b19b1..fa3de58 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.4 \ No newline at end of file +0.0.5 \ No newline at end of file diff --git a/xenith/core/trainer.cpp b/xenith/core/trainer.cpp index d25fb18..3c7b5e3 100644 --- a/xenith/core/trainer.cpp +++ b/xenith/core/trainer.cpp @@ -91,7 +91,7 @@ TrainStats train_model(Params& p, const Tokenizer& tok, const std::string& corpu auto now = std::chrono::steady_clock::now(); double dt = std::chrono::duration(now - t0).count(); double tps = dt > 0 ? st.tokens_seen / dt : 0; - fprintf(stderr, "шаг %5d/%d loss %.4f ppl %8.2f lr %.2e %6.0f ток/с\n", + fprintf(stderr, "шаг %5d/%d loss %.4f ppl %8.2f lr %.2e %6.0f ток/с\r", step, tc.steps, loss, std::exp(loss), lr_at(tc, step), tps); diff --git a/xenith/ui/tui.cpp b/xenith/ui/tui.cpp index 33c411d..7acd208 100644 --- a/xenith/ui/tui.cpp +++ b/xenith/ui/tui.cpp @@ -20,7 +20,7 @@ namespace ui draw_button(2, 2 + 3, panel_w - 2, 3, "Models", border_clip); draw_button(2, 2 + 6, panel_w - 2, 3, "Settings", border_clip); draw_button(2, 2 + 9, panel_w - 2, 3, "Server", border_clip); - std::cout << "\033[?1000h\033[?1002h\033[?1006h" << std::flush; + //std::cout << "\033[?1000h\033[?1002h\033[?1006h" << std::flush; } Tui::~Tui()