Skip to content

Commit 84a9bf2

Browse files
ngxsonggerganov
andauthored
mtmd : merge llava, gemma3 and minicpmv CLI into single llama-mtmd-cli (#13012)
* mtmd : merge `llava-cli` and `gemma3-cli` into single `mtmd-cli` * support for minicpmv * remove cpp files of llava and minicpmv * update hot topics * mtmd : add not supported msg for qwen2vl * Update examples/llava/mtmd.cpp Co-authored-by: Georgi Gerganov <[email protected]> --------- Co-authored-by: Georgi Gerganov <[email protected]>
1 parent 2016f07 commit 84a9bf2

File tree

10 files changed

+359
-771
lines changed

10 files changed

+359
-771
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Inference of Meta's [LLaMA](https://arxiv.org/abs/2302.13971) model (and others)
1616

1717
## Hot topics
1818

19+
- A new binary `llama-mtmd-cli` is introduced to replace `llava-cli`, `minicpmv-cli` and `gemma3-cli` https://github.com/ggml-org/llama.cpp/pull/13012, `libllava` will be deprecated
1920
- **How to use [MTLResidencySet](https://developer.apple.com/documentation/metal/mtlresidencyset?language=objc) to keep the GPU memory active?** https://github.com/ggml-org/llama.cpp/pull/11427
2021
- **VS Code extension for FIM completions:** https://github.com/ggml-org/llama.vscode
2122
- Universal [tool call support](./docs/function-calling.md) in `llama-server` https://github.com/ggml-org/llama.cpp/pull/9639

common/arg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2726,7 +2726,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
27262726
[](common_params & params, const std::string & value) {
27272727
params.chat_template = value;
27282728
}
2729-
).set_examples({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_CHAT_TEMPLATE"));
2729+
).set_examples({LLAMA_EXAMPLE_MAIN, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_LLAVA}).set_env("LLAMA_ARG_CHAT_TEMPLATE"));
27302730
add_opt(common_arg(
27312731
{"--chat-template-file"}, "JINJA_TEMPLATE_FILE",
27322732
string_format(

examples/llava/CMakeLists.txt

+6-16
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,9 @@ if(TARGET BUILD_INFO)
6161
add_dependencies(mtmd BUILD_INFO)
6262
endif()
6363

64-
set(TARGET llama-llava-cli)
65-
add_executable(${TARGET} llava-cli.cpp)
66-
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME llama-llava-cli)
67-
install(TARGETS ${TARGET} RUNTIME)
68-
target_link_libraries(${TARGET} PRIVATE common llava ${CMAKE_THREAD_LIBS_INIT})
69-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
70-
71-
set(TARGET llama-minicpmv-cli)
72-
add_executable(${TARGET} minicpmv-cli.cpp)
73-
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME llama-minicpmv-cli)
74-
install(TARGETS ${TARGET} RUNTIME)
75-
target_link_libraries(${TARGET} PRIVATE common llava ${CMAKE_THREAD_LIBS_INIT})
76-
target_compile_features(${TARGET} PRIVATE cxx_std_17)
64+
add_executable(llama-llava-cli deprecation-warning.cpp)
65+
add_executable(llama-gemma3-cli deprecation-warning.cpp)
66+
add_executable(llama-minicpmv-cli deprecation-warning.cpp)
7767

7868
set(TARGET llama-qwen2vl-cli)
7969
add_executable(${TARGET} qwen2vl-cli.cpp)
@@ -82,9 +72,9 @@ install(TARGETS ${TARGET} RUNTIME)
8272
target_link_libraries(${TARGET} PRIVATE common llava ${CMAKE_THREAD_LIBS_INIT})
8373
target_compile_features(${TARGET} PRIVATE cxx_std_17)
8474

85-
set(TARGET llama-gemma3-cli)
86-
add_executable(${TARGET} gemma3-cli.cpp)
87-
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME llama-gemma3-cli)
75+
set(TARGET llama-mtmd-cli)
76+
add_executable(${TARGET} mtmd-cli.cpp)
77+
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME llama-mtmd-cli)
8878
install(TARGETS ${TARGET} RUNTIME)
8979
target_link_libraries(${TARGET} PRIVATE common mtmd ${CMAKE_THREAD_LIBS_INIT})
9080
target_compile_features(${TARGET} PRIVATE cxx_std_17)
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <cstdio>
2+
#include <string>
3+
4+
int main(int argc, char** argv) {
5+
std::string filename = "main";
6+
if (argc >= 1) {
7+
filename = argv[0];
8+
}
9+
10+
// Get only the program name from the full path
11+
size_t pos = filename.find_last_of("/\\");
12+
if (pos != std::string::npos) {
13+
filename = filename.substr(pos+1);
14+
}
15+
16+
fprintf(stdout, "\n");
17+
fprintf(stdout, "WARNING: The binary '%s' is deprecated.\n", filename.c_str());
18+
fprintf(stdout, "Please use 'llama-mtmd-cli' instead.\n");
19+
fprintf(stdout, "\n");
20+
21+
return EXIT_FAILURE;
22+
}

0 commit comments

Comments
 (0)