@@ -834,9 +834,11 @@ static bool common_params_parse_ex(int argc, char ** argv, common_params_context
834834
835835 // allow --mmproj to be set from -hf
836836 // assuming that mmproj is always in the same repo as text model
837- if (!params.model .hf_repo .empty () && ctx_arg.ex == LLAMA_EXAMPLE_LLAVA) {
837+ if (!params.model .hf_repo .empty () && (
838+ ctx_arg.ex == LLAMA_EXAMPLE_LLAVA || ctx_arg.ex == LLAMA_EXAMPLE_SERVER)) {
838839 params.mmproj .hf_repo = params.model .hf_repo ;
839840 }
841+ // TODO @ngxson : this will break non-vision model with -hf, need to fix before merging
840842 common_params_handle_model (params.mmproj , params.hf_token , " " , true );
841843
842844 if (params.escape ) {
@@ -2101,14 +2103,14 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
21012103 [](common_params & params, const std::string & value) {
21022104 params.mmproj .path = value;
21032105 }
2104- ).set_examples ({LLAMA_EXAMPLE_LLAVA}));
2106+ ).set_examples ({LLAMA_EXAMPLE_LLAVA, LLAMA_EXAMPLE_SERVER }));
21052107 add_opt (common_arg (
21062108 {" --mmproj-url" }, " URL" ,
21072109 " URL to a multimodal projector file for LLaVA. see examples/llava/README.md" ,
21082110 [](common_params & params, const std::string & value) {
21092111 params.mmproj .url = value;
21102112 }
2111- ).set_examples ({LLAMA_EXAMPLE_LLAVA}));
2113+ ).set_examples ({LLAMA_EXAMPLE_LLAVA, LLAMA_EXAMPLE_SERVER }));
21122114 add_opt (common_arg (
21132115 {" --image" }, " FILE" ,
21142116 " path to an image file. use with multimodal models. Specify multiple times for batching" ,
0 commit comments