From d3f7a1f927e922ffbc38c6ad1cc169c8bbf7a7d1 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Fri, 9 May 2025 23:39:28 +0200 Subject: [PATCH 1/2] arg : add env var to control mmproj --- common/arg.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/arg.cpp b/common/arg.cpp index f67e0d96d702a..df033cc4802a3 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -2208,28 +2208,28 @@ common_params_context common_params_parser_init(common_params & params, llama_ex [](common_params & params, const std::string & value) { params.mmproj.path = value; } - ).set_examples(mmproj_examples)); + ).set_examples(mmproj_examples).set_env("LLAMA_ARG_MMPROJ")); add_opt(common_arg( {"--mmproj-url"}, "URL", "URL to a multimodal projector file. see tools/mtmd/README.md", [](common_params & params, const std::string & value) { params.mmproj.url = value; } - ).set_examples(mmproj_examples)); + ).set_examples(mmproj_examples).set_env("LLAMA_ARG_MMPROJ_URL")); add_opt(common_arg( {"--no-mmproj"}, "explicitly disable multimodal projector, useful when using -hf", [](common_params & params) { params.no_mmproj = true; } - ).set_examples(mmproj_examples)); + ).set_examples(mmproj_examples).set_env("LLAMA_ARG_NO_MMPROJ")); add_opt(common_arg( {"--no-mmproj-offload"}, "do not offload multimodal projector to GPU", [](common_params & params) { params.mmproj_use_gpu = false; } - ).set_examples(mmproj_examples)); + ).set_examples(mmproj_examples).set_env("LLAMA_ARG_NO_MMPROJ_OFFLOAD")); add_opt(common_arg( {"--image"}, "FILE", "path to an image file. use with multimodal models. Specify multiple times for batching", From 1cba73458b057c128acaf83e9d8795443ea54af5 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Fri, 9 May 2025 23:42:54 +0200 Subject: [PATCH 2/2] small note about -hf --mmproj --- common/arg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/arg.cpp b/common/arg.cpp index df033cc4802a3..e0f1d998f6056 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -2204,7 +2204,8 @@ common_params_context common_params_parser_init(common_params & params, llama_ex ).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_NO_CONT_BATCHING")); add_opt(common_arg( {"--mmproj"}, "FILE", - "path to a multimodal projector file. see tools/mtmd/README.md", + "path to a multimodal projector file. see tools/mtmd/README.md\n" + "note: if -hf is used, this argument can be omitted", [](common_params & params, const std::string & value) { params.mmproj.path = value; }