forked from janhq/cortex.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_line_parser.h
More file actions
68 lines (54 loc) · 1.74 KB
/
command_line_parser.h
File metadata and controls
68 lines (54 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include <memory>
#include <unordered_map>
#include "CLI/CLI.hpp"
#include "commands/hardware_list_cmd.h"
#include "services/engine_service.h"
#include "utils/config_yaml_utils.h"
class CommandLineParser {
public:
CommandLineParser();
bool SetupCommand(int argc, char** argv);
private:
void SetupCommonCommands();
void SetupModelCommands();
void SetupEngineCommands();
void SetupHardwareCommands();
void SetupSystemCommands();
void SetupConfigsCommands();
void ModelUpdate(CLI::App* parent);
CLI::App app_;
std::shared_ptr<DownloadService> download_service_;
std::shared_ptr<cortex::DylibPathManager> dylib_path_manager_;
std::shared_ptr<DatabaseService> db_service_;
std::shared_ptr<EngineService> engine_service_;
struct CmlData {
std::string model_id;
std::string msg;
std::string model_alias;
std::string model_path;
std::string engine_name;
std::string engine_version = "latest";
std::string engine_src;
std::string cortex_version;
bool check_upd = true;
bool run_detach = false;
// for model list
bool display_engine = false;
bool display_version = false;
bool display_cpu_mode = false;
bool display_gpu_mode = false;
bool display_available_model = false;
std::string filter = "";
bool show_menu = false;
config_yaml_utils::CortexConfig config;
std::unordered_map<std::string, std::string> model_update_options;
std::unordered_map<std::string, std::string> server_start_options;
std::string model_src;
};
CmlData cml_data_;
std::unordered_map<std::string, std::string> config_update_opts_;
bool executed_ = false;
commands::HarwareOptions hw_opts_;
std::unordered_map<std::string, std::string> run_settings_;
};