From 7253857519f05bd041cce882926bd5ac286d4630 Mon Sep 17 00:00:00 2001 From: 0xSage Date: Fri, 13 Sep 2024 16:54:55 +0800 Subject: [PATCH 1/2] chore: minor copy nits --- engine/commands/cortex_upd_cmd.h | 2 +- engine/e2e-test/test_cortex_update.py | 6 ++---- engine/services/download_service.cc | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/engine/commands/cortex_upd_cmd.h b/engine/commands/cortex_upd_cmd.h index b8aac9e7b..693ed9113 100644 --- a/engine/commands/cortex_upd_cmd.h +++ b/engine/commands/cortex_upd_cmd.h @@ -100,7 +100,7 @@ inline bool ReplaceBinaryInflight(const std::filesystem::path& src, std::filesystem::perms::others_read | std::filesystem::perms::others_exec); } catch (const std::exception& e) { - CTL_ERR("Something wrong happened: " << e.what()); + CTL_ERR("Something went wrong: " << e.what()); if (std::filesystem::exists(temp)) { std::rename(temp.string().c_str(), dst.string().c_str()); CLI_LOG("Restored binary file"); diff --git a/engine/e2e-test/test_cortex_update.py b/engine/e2e-test/test_cortex_update.py index fc1fe25cb..0c4d3a774 100644 --- a/engine/e2e-test/test_cortex_update.py +++ b/engine/e2e-test/test_cortex_update.py @@ -1,5 +1,3 @@ -import platform - import pytest from test_runner import run @@ -10,5 +8,5 @@ class TestCortexUpdate: @pytest.mark.skip(reason="Stable release is not available yet") def test_cortex_update(self): exit_code, output, error = run("Update cortex", ["update"]) - assert exit_code == 0, f"Something wrong happened" - assert "Update cortex sucessfully" in output + assert exit_code == 0, "Something went wrong" + assert "Updated cortex sucessfully" in output diff --git a/engine/services/download_service.cc b/engine/services/download_service.cc index 78a0c4757..f8b1b814a 100644 --- a/engine/services/download_service.cc +++ b/engine/services/download_service.cc @@ -82,7 +82,7 @@ void DownloadService::StartDownloadItem( if (current == total) { outputFile.flush(); outputFile.close(); - CLI_LOG("Done download: " << static_cast(total) / 1024 / 1024 + CLI_LOG("Finished download: " << static_cast(total) / 1024 / 1024 << " MiB"); if (callback.has_value()) { auto need_parse_gguf = From 7208a526451f93f5746435227c1202cc94804782 Mon Sep 17 00:00:00 2001 From: 0xSage Date: Fri, 13 Sep 2024 17:04:30 +0800 Subject: [PATCH 2/2] copy edits --- engine/controllers/command_line_parser.cc | 7 +++---- platform/src/infrastructure/commanders/chat.command.ts | 2 +- .../infrastructure/commanders/models/model-pull.command.ts | 2 +- platform/src/infrastructure/commanders/run.command.ts | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/engine/controllers/command_line_parser.cc b/engine/controllers/command_line_parser.cc index c21f893fd..6e1086032 100644 --- a/engine/controllers/command_line_parser.cc +++ b/engine/controllers/command_line_parser.cc @@ -80,9 +80,8 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { auto model_pull_cmd = app_.add_subcommand("pull", - "Download a model from a registry. Working with " - "HuggingFace repositories. For available models, " - "please visit https://huggingface.co/cortexso"); + "Download a model by URL (or HuggingFace ID) " + "See built-in models: https://huggingface.co/cortexso"); model_pull_cmd->add_option("model_id", model_id, ""); model_pull_cmd->callback([&model_id]() { @@ -100,7 +99,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { std::string msg; { auto chat_cmd = - app_.add_subcommand("chat", "Send a chat request to a model"); + app_.add_subcommand("chat", "Send a chat completion request"); chat_cmd->add_option("model_id", model_id, ""); chat_cmd->add_option("-m,--message", msg, "Message to chat with model"); diff --git a/platform/src/infrastructure/commanders/chat.command.ts b/platform/src/infrastructure/commanders/chat.command.ts index 35b2ef5ba..1728f7dba 100644 --- a/platform/src/infrastructure/commanders/chat.command.ts +++ b/platform/src/infrastructure/commanders/chat.command.ts @@ -29,7 +29,7 @@ type ChatOptions = { @SubCommand({ name: 'chat', - description: 'Send a chat request to a model', + description: 'Send a chat completion request', arguments: '[model_id] [message]', argsDescription: { model_id: diff --git a/platform/src/infrastructure/commanders/models/model-pull.command.ts b/platform/src/infrastructure/commanders/models/model-pull.command.ts index 179484845..2d5b03799 100644 --- a/platform/src/infrastructure/commanders/models/model-pull.command.ts +++ b/platform/src/infrastructure/commanders/models/model-pull.command.ts @@ -26,7 +26,7 @@ import { fileManagerService } from '@/infrastructure/services/file-manager/file- arguments: '', argsDescription: { model_id: 'Model repo to pull' }, description: - 'Download a model from a registry. Working with HuggingFace repositories. For available models, please visit https://huggingface.co/cortexso', + 'Download a model by URL (or HuggingFace ID). See built-in models: https://huggingface.co/cortexso', }) @SetCommandContext() export class ModelPullCommand extends BaseCommand { diff --git a/platform/src/infrastructure/commanders/run.command.ts b/platform/src/infrastructure/commanders/run.command.ts index 3d30b6a16..784a8443b 100644 --- a/platform/src/infrastructure/commanders/run.command.ts +++ b/platform/src/infrastructure/commanders/run.command.ts @@ -32,7 +32,7 @@ type RunOptions = { model_id: 'Model to run. If the model is not available, it will attempt to pull.', }, - description: 'Shortcut to start a model and chat', + description: 'Shortcut: start a model and interactive chat shell', }) export class RunCommand extends BaseCommand { chatClient: ChatClient;