@@ -163,16 +163,18 @@ void CommandLineParser::SetupCommonCommands() {
163163 run_cmd->usage (" Usage:\n " + commands::GetCortexBinary () +
164164 " run [options] [model_id]" );
165165 run_cmd->add_option (" model_id" , cml_data_.model_id , " " );
166- run_cmd->add_option (" --gpus" , hw_activate_opts_ [" gpus" ],
166+ run_cmd->add_option (" --gpus" , run_settings_ [" gpus" ],
167167 " List of GPU to activate, for example [0, 1]" );
168+ run_cmd->add_option (" --ctx_len" , run_settings_[" ctx_len" ],
169+ " Maximum context length for inference" );
168170 run_cmd->add_flag (" -d,--detach" , cml_data_.run_detach , " Detached mode" );
169171 run_cmd->callback ([this , run_cmd] {
170172 if (std::exchange (executed_, true ))
171173 return ;
172174 commands::RunCmd rc (cml_data_.config .apiServerHost ,
173175 std::stoi (cml_data_.config .apiServerPort ),
174176 cml_data_.model_id , download_service_);
175- rc.Exec (cml_data_.run_detach , hw_activate_opts_ );
177+ rc.Exec (cml_data_.run_detach , run_settings_ );
176178 });
177179}
178180
@@ -203,8 +205,10 @@ void CommandLineParser::SetupModelCommands() {
203205 model_start_cmd->usage (" Usage:\n " + commands::GetCortexBinary () +
204206 " models start [model_id]" );
205207 model_start_cmd->add_option (" model_id" , cml_data_.model_id , " " );
206- model_start_cmd->add_option (" --gpus" , hw_activate_opts_ [" gpus" ],
208+ model_start_cmd->add_option (" --gpus" , run_settings_ [" gpus" ],
207209 " List of GPU to activate, for example [0, 1]" );
210+ model_start_cmd->add_option (" --ctx_len" , run_settings_[" ctx_len" ],
211+ " Maximum context length for inference" );
208212 model_start_cmd->group (kSubcommands );
209213 model_start_cmd->callback ([this , model_start_cmd]() {
210214 if (std::exchange (executed_, true ))
@@ -216,7 +220,7 @@ void CommandLineParser::SetupModelCommands() {
216220 };
217221 commands::ModelStartCmd ().Exec (cml_data_.config .apiServerHost ,
218222 std::stoi (cml_data_.config .apiServerPort ),
219- cml_data_.model_id , hw_activate_opts_ );
223+ cml_data_.model_id , run_settings_ );
220224 });
221225
222226 auto stop_model_cmd =
@@ -562,7 +566,7 @@ void CommandLineParser::SetupHardwareCommands() {
562566 hw_activate_cmd->usage (" Usage:\n " + commands::GetCortexBinary () +
563567 " hardware activate --gpus [list_gpu]" );
564568 hw_activate_cmd->group (kSubcommands );
565- hw_activate_cmd->add_option (" --gpus" , hw_activate_opts_ [" gpus" ],
569+ hw_activate_cmd->add_option (" --gpus" , run_settings_ [" gpus" ],
566570 " List of GPU to activate, for example [0, 1]" );
567571 hw_activate_cmd->callback ([this , hw_activate_cmd]() {
568572 if (std::exchange (executed_, true ))
@@ -572,14 +576,14 @@ void CommandLineParser::SetupHardwareCommands() {
572576 return ;
573577 }
574578
575- if (hw_activate_opts_ [" gpus" ].empty ()) {
579+ if (run_settings_ [" gpus" ].empty ()) {
576580 CLI_LOG (" [list_gpu] is required\n " );
577581 CLI_LOG (hw_activate_cmd->help ());
578582 return ;
579583 }
580584 commands::HardwareActivateCmd ().Exec (
581585 cml_data_.config .apiServerHost ,
582- std::stoi (cml_data_.config .apiServerPort ), hw_activate_opts_ );
586+ std::stoi (cml_data_.config .apiServerPort ), run_settings_ );
583587 });
584588}
585589
0 commit comments