From dd2fcfb27ccca47fbfcc1c1cfa22057e5c35e4cf Mon Sep 17 00:00:00 2001 From: Nicole Zhu Date: Fri, 25 Oct 2024 10:47:52 +0800 Subject: [PATCH] chore: copy edits --- docs/docs/cli/cortex.mdx | 2 +- engine/cli/command_line_parser.cc | 38 +++++++++++++-------------- engine/cli/commands/cortex_upd_cmd.cc | 2 +- engine/cli/commands/ps_cmd.cc | 4 +-- engine/controllers/swagger.cc | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/docs/cli/cortex.mdx b/docs/docs/cli/cortex.mdx index 517494c07..ef887dd10 100644 --- a/docs/docs/cli/cortex.mdx +++ b/docs/docs/cli/cortex.mdx @@ -62,7 +62,7 @@ For example: - [cortex embeddings](/docs/cli/embeddings): Create an embedding vector representing the input text. - [cortex engines](/docs/cli/engines): Manage Cortex.cpp engines. - [cortex pull|download](/docs/cli/pull): Download a model. -- [cortex run](/docs/cli/run): Shortcut to start a model and chat. +- [cortex run](/docs/cli/run): Shortcut to pull, start and chat with a model. - [cortex update](/docs/cli/update): Update the Cortex.cpp version. - [cortex start](/docs/cli/start): Start the Cortex.cpp API server. - [cortex stop](/docs/cli/stop): Stop the Cortex.cpp API server. diff --git a/engine/cli/command_line_parser.cc b/engine/cli/command_line_parser.cc index c40c90a9e..bc45ce3f5 100644 --- a/engine/cli/command_line_parser.cc +++ b/engine/cli/command_line_parser.cc @@ -28,12 +28,12 @@ constexpr const auto kCommonCommandsGroup = "Common Commands"; constexpr const auto kInferenceGroup = "Inference"; constexpr const auto kModelsGroup = "Models"; constexpr const auto kEngineGroup = "Engines"; -constexpr const auto kSystemGroup = "System"; +constexpr const auto kSystemGroup = "Server"; constexpr const auto kSubcommands = "Subcommands"; } // namespace CommandLineParser::CommandLineParser() - : app_("Cortex.cpp CLI"), + : app_("\nCortex.cpp CLI\n"), download_service_{std::make_shared()}, model_service_{ModelService(download_service_)}, engine_service_{EngineService(download_service_)} {} @@ -55,12 +55,12 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { SetupSystemCommands(); - app_.add_flag("--verbose", log_verbose, "Verbose logging"); + app_.add_flag("--verbose", log_verbose, "Get verbose logs"); // Logic is handled in main.cc, just for cli helper command std::string path; - app_.add_option("--config_file_path", path, "Configuration file path"); - app_.add_option("--data_folder_path", path, "Data folder path"); + app_.add_option("--config_file_path", path, "Configure .rc file path"); + app_.add_option("--data_folder_path", path, "Configure data folder path"); // cortex version auto cb = [&](int c) { @@ -70,7 +70,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { CLI_LOG("default"); #endif }; - app_.add_flag_function("-v,--version", cb, "Cortex version"); + app_.add_flag_function("-v,--version", cb, "Get Cortex version"); CLI11_PARSE(app_, argc, argv); if (argc == 1) { @@ -91,9 +91,9 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { commands::CheckNewUpdate(commands::kTimeoutCheckUpdate); latest_version.has_value() && *latest_version != CORTEX_CPP_VERSION) { - CLI_LOG("\nA new release of cortex is available: " + CLI_LOG("\nNew Cortex release available: " << CORTEX_CPP_VERSION << " -> " << *latest_version); - CLI_LOG("To upgrade, run: " << commands::GetRole() + CLI_LOG("To update, run: " << commands::GetRole() << commands::GetCortexBinary() << " update"); } @@ -115,7 +115,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { void CommandLineParser::SetupCommonCommands() { auto model_pull_cmd = app_.add_subcommand( "pull", - "Download a model by URL (or HuggingFace ID) " + "Download models by HuggingFace Repo/ModelID" "See built-in models: https://huggingface.co/cortexso"); model_pull_cmd->group(kCommonCommandsGroup); model_pull_cmd->usage("Usage:\n" + commands::GetCortexBinary() + @@ -136,7 +136,7 @@ void CommandLineParser::SetupCommonCommands() { } }); - auto run_cmd = app_.add_subcommand("run", "Shortcut to start a model"); + auto run_cmd = app_.add_subcommand("run", "Shortcut: pull, start & chat with a model"); run_cmd->group(kCommonCommandsGroup); run_cmd->usage("Usage:\n" + commands::GetCortexBinary() + " run [options] [model_id]"); @@ -213,7 +213,7 @@ void CommandLineParser::SetupModelCommands() { }); auto list_models_cmd = - models_cmd->add_subcommand("list", "List all models locally"); + models_cmd->add_subcommand("list", "List all local models"); list_models_cmd->add_option("filter", cml_data_.filter, "Filter model id"); list_models_cmd->add_flag("-e,--engine", cml_data_.display_engine, "Display engine"); @@ -230,7 +230,7 @@ void CommandLineParser::SetupModelCommands() { }); auto get_models_cmd = - models_cmd->add_subcommand("get", "Get info of {model_id} locally"); + models_cmd->add_subcommand("get", "Get a local model info by ID"); get_models_cmd->usage("Usage:\n" + commands::GetCortexBinary() + " models get [model_id]"); get_models_cmd->group(kSubcommands); @@ -249,7 +249,7 @@ void CommandLineParser::SetupModelCommands() { }); auto model_del_cmd = - models_cmd->add_subcommand("delete", "Delete a model by ID locally"); + models_cmd->add_subcommand("delete", "Delete a local model by ID"); model_del_cmd->usage("Usage:\n" + commands::GetCortexBinary() + " models delete [model_id]"); model_del_cmd->group(kSubcommands); @@ -270,13 +270,13 @@ void CommandLineParser::SetupModelCommands() { std::string model_alias; auto model_alias_cmd = - models_cmd->add_subcommand("alias", "Add alias name for a modelID"); + models_cmd->add_subcommand("alias", "Add a model alias instead of ID"); model_alias_cmd->usage("Usage:\n" + commands::GetCortexBinary() + " models alias --model_id [model_id] --alias [alias]"); model_alias_cmd->group(kSubcommands); model_alias_cmd->add_option( "--model_id", cml_data_.model_id, - "Can be modelID or model alias to identify model"); + "Can be a model ID or model alias"); model_alias_cmd->add_option("--alias", cml_data_.model_alias, "new alias to be set"); model_alias_cmd->callback([this, model_alias_cmd]() { @@ -297,7 +297,7 @@ void CommandLineParser::SetupModelCommands() { std::string model_path; auto model_import_cmd = models_cmd->add_subcommand( - "import", "Import a gguf model from local file"); + "import", "Import a model from a local filepath"); model_import_cmd->usage( "Usage:\n" + commands::GetCortexBinary() + " models import --model_id [model_id] --model_path [model_path]"); @@ -416,7 +416,7 @@ void CommandLineParser::SetupSystemCommands() { }); auto ps_cmd = - app_.add_subcommand("ps", "Show running models and their status"); + app_.add_subcommand("ps", "Show active model statuses"); ps_cmd->group(kSystemGroup); ps_cmd->usage("Usage:\n" + commands::GetCortexBinary() + "ps"); ps_cmd->callback([&]() { @@ -491,7 +491,7 @@ void CommandLineParser::EngineUninstall(CLI::App* parent, } void CommandLineParser::EngineGet(CLI::App* parent) { - auto get_cmd = parent->add_subcommand("get", "Get an engine info"); + auto get_cmd = parent->add_subcommand("get", "Get engine info"); get_cmd->usage("Usage:\n" + commands::GetCortexBinary() + " engines get [engine_name] [options]"); get_cmd->group(kSubcommands); @@ -524,7 +524,7 @@ void CommandLineParser::EngineGet(CLI::App* parent) { void CommandLineParser::ModelUpdate(CLI::App* parent) { auto model_update_cmd = - parent->add_subcommand("update", "Update configuration of a model"); + parent->add_subcommand("update", "Update model configurations"); model_update_cmd->group(kSubcommands); model_update_cmd->add_option("--model_id", cml_data_.model_id, "Model ID") ->required(); diff --git a/engine/cli/commands/cortex_upd_cmd.cc b/engine/cli/commands/cortex_upd_cmd.cc index b926148f3..6983de470 100644 --- a/engine/cli/commands/cortex_upd_cmd.cc +++ b/engine/cli/commands/cortex_upd_cmd.cc @@ -304,7 +304,7 @@ void CortexUpdCmd::Exec(const std::string& v, bool force) { if (!GetNightly(v)) return; } - CLI_LOG("Update cortex sucessfully"); + CLI_LOG("Updated cortex successfully"); } bool CortexUpdCmd::GetStable(const std::string& v) { diff --git a/engine/cli/commands/ps_cmd.cc b/engine/cli/commands/ps_cmd.cc index 970a6365d..fe84031a4 100644 --- a/engine/cli/commands/ps_cmd.cc +++ b/engine/cli/commands/ps_cmd.cc @@ -16,7 +16,7 @@ void PsCmd::Exec(const std::string& host, int port) { auto res = cli.Get("/inferences/server/models"); if (!res || res->status != httplib::StatusCode::OK_200) { - CLI_LOG("No model loaded!"); + CLI_LOG("No models loaded!"); return; } @@ -44,7 +44,7 @@ void PsCmd::Exec(const std::string& host, int port) { void PsCmd::PrintModelStatusList( const std::vector& model_status_list) const { if (model_status_list.empty()) { - CLI_LOG("No model loaded!"); + CLI_LOG("No models loaded!"); return; } diff --git a/engine/controllers/swagger.cc b/engine/controllers/swagger.cc index d64cb5029..d605daa0b 100644 --- a/engine/controllers/swagger.cc +++ b/engine/controllers/swagger.cc @@ -5,7 +5,7 @@ constexpr auto ScalarUi = R"( - Scalar API Reference + Cortex API Reference