Skip to content

Commit 84b7dfe

Browse files
committed
add makefile entry, update speical image padding token
1 parent cbd08b4 commit 84b7dfe

File tree

3 files changed

+94
-85
lines changed

3 files changed

+94
-85
lines changed

CMakePresets.json

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
11
{
2-
"version": 4,
3-
"configurePresets": [
4-
{
5-
"name": "base",
6-
"hidden": true,
7-
"generator": "Ninja",
8-
"binaryDir": "${sourceDir}/build-${presetName}",
9-
"cacheVariables": {
10-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
11-
"CMAKE_INSTALL_RPATH": "$ORIGIN;$ORIGIN/.."
12-
}
13-
},
14-
{
15-
"name": "sycl-base",
16-
"hidden": true,
17-
"generator": "Ninja",
18-
"binaryDir": "${sourceDir}/build-${presetName}",
19-
"cacheVariables": {
20-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
21-
"CMAKE_CXX_COMPILER": "icx",
22-
"CMAKE_C_COMPILER": "cl",
23-
"GGML_SYCL": "ON",
24-
"CMAKE_INSTALL_RPATH": "$ORIGIN;$ORIGIN/.."
25-
}
26-
},
27-
{ "name": "debug", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
28-
{ "name": "release", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } },
29-
{ "name": "reldbg", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
30-
{ "name": "static", "hidden": true, "cacheVariables": { "GGML_STATIC": "ON" } },
31-
{ "name": "sycl_f16", "hidden": true, "cacheVariables": { "GGML_SYCL_F16": "ON" } },
32-
{ "name": "vulkan", "hidden": true, "cacheVariables": { "GGML_VULKAN": "ON" } },
33-
34-
{
35-
"name": "arm64-windows-msvc", "hidden": true,
36-
"architecture": { "value": "arm64", "strategy": "external" },
37-
"toolset": { "value": "host=x64", "strategy": "external" },
38-
"cacheVariables": {
39-
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-windows-msvc.cmake"
40-
}
41-
},
42-
43-
{
44-
"name": "arm64-windows-llvm", "hidden": true,
45-
"architecture": { "value": "arm64", "strategy": "external" },
46-
"toolset": { "value": "host=x64", "strategy": "external" },
47-
"cacheVariables": {
48-
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-windows-llvm.cmake"
49-
}
50-
},
51-
52-
{
53-
"name": "arm64-apple-clang", "hidden": true,
54-
"architecture": { "value": "arm64", "strategy": "external" },
55-
"toolset": { "value": "host=x64", "strategy": "external" },
56-
"cacheVariables": {
57-
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-apple-clang.cmake"
58-
}
59-
},
60-
61-
{ "name": "arm64-windows-llvm-debug", "inherits": [ "base", "arm64-windows-llvm", "debug" ] },
62-
{ "name": "arm64-windows-llvm-release", "inherits": [ "base", "arm64-windows-llvm", "reldbg" ] },
63-
{ "name": "arm64-windows-llvm+static-release", "inherits": [ "base", "arm64-windows-llvm", "reldbg", "static" ] },
64-
65-
{ "name": "arm64-apple-clang-debug", "inherits": [ "base", "arm64-apple-clang", "debug" ] },
66-
{ "name": "arm64-apple-clang-release", "inherits": [ "base", "arm64-apple-clang", "reldbg" ] },
67-
{ "name": "arm64-apple-clang+static-release", "inherits": [ "base", "arm64-apple-clang", "reldbg", "static" ] },
68-
69-
{ "name": "arm64-windows-msvc-debug", "inherits": [ "base", "arm64-windows-msvc", "debug" ] },
70-
{ "name": "arm64-windows-msvc-release", "inherits": [ "base", "arm64-windows-msvc", "reldbg" ] },
71-
{ "name": "arm64-windows-msvc+static-release", "inherits": [ "base", "arm64-windows-msvc", "reldbg", "static" ] },
72-
73-
{ "name": "x64-windows-msvc-debug", "inherits": [ "base", "debug" ] },
74-
{ "name": "x64-windows-msvc-release", "inherits": [ "base", "reldbg" ] },
75-
{ "name": "x64-windows-msvc+static-release", "inherits": [ "base", "reldbg", "static" ] },
76-
77-
{ "name": "x64-windows-sycl-debug", "inherits": [ "sycl-base", "debug" ] },
78-
{ "name": "x64-windows-sycl-debug-f16", "inherits": [ "sycl-base", "debug", "sycl_f16" ] },
79-
{ "name": "x64-windows-sycl-release", "inherits": [ "sycl-base", "release" ] },
80-
{ "name": "x64-windows-sycl-release-f16", "inherits": [ "sycl-base", "release", "sycl_f16" ] },
81-
82-
{ "name": "x64-windows-vulkan-debug", "inherits": [ "base", "vulkan", "debug" ] },
83-
{ "name": "x64-windows-vulkan-release", "inherits": [ "base", "vulkan", "release" ] }
84-
]
85-
}
2+
"version": 4,
3+
"configurePresets": [
4+
{
5+
"name": "base",
6+
"hidden": true,
7+
"generator": "Ninja",
8+
"binaryDir": "${sourceDir}/build-${presetName}",
9+
"cacheVariables": {
10+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
11+
"CMAKE_INSTALL_RPATH": "$ORIGIN;$ORIGIN/.."
12+
}
13+
},
14+
{
15+
"name": "sycl-base",
16+
"hidden": true,
17+
"generator": "Ninja",
18+
"binaryDir": "${sourceDir}/build-${presetName}",
19+
"cacheVariables": {
20+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
21+
"CMAKE_CXX_COMPILER": "icx",
22+
"CMAKE_C_COMPILER": "cl",
23+
"GGML_SYCL": "ON",
24+
"CMAKE_INSTALL_RPATH": "$ORIGIN;$ORIGIN/.."
25+
}
26+
},
27+
{ "name": "debug", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
28+
{ "name": "release", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } },
29+
{ "name": "reldbg", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" } },
30+
{ "name": "static", "hidden": true, "cacheVariables": { "GGML_STATIC": "ON" } },
31+
{ "name": "sycl_f16", "hidden": true, "cacheVariables": { "GGML_SYCL_F16": "ON" } },
32+
{ "name": "vulkan", "hidden": true, "cacheVariables": { "GGML_VULKAN": "ON" } },
33+
34+
{
35+
"name": "arm64-windows-msvc", "hidden": true,
36+
"architecture": { "value": "arm64", "strategy": "external" },
37+
"toolset": { "value": "host=x64", "strategy": "external" },
38+
"cacheVariables": {
39+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-windows-msvc.cmake"
40+
}
41+
},
42+
43+
{
44+
"name": "arm64-windows-llvm", "hidden": true,
45+
"architecture": { "value": "arm64", "strategy": "external" },
46+
"toolset": { "value": "host=x64", "strategy": "external" },
47+
"cacheVariables": {
48+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-windows-llvm.cmake"
49+
}
50+
},
51+
52+
{
53+
"name": "arm64-apple-clang", "hidden": true,
54+
"architecture": { "value": "arm64", "strategy": "external" },
55+
"toolset": { "value": "host=x64", "strategy": "external" },
56+
"cacheVariables": {
57+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-apple-clang.cmake"
58+
}
59+
},
60+
61+
{ "name": "arm64-windows-llvm-debug", "inherits": [ "base", "arm64-windows-llvm", "debug" ] },
62+
{ "name": "arm64-windows-llvm-release", "inherits": [ "base", "arm64-windows-llvm", "reldbg" ] },
63+
{ "name": "arm64-windows-llvm+static-release", "inherits": [ "base", "arm64-windows-llvm", "reldbg", "static" ] },
64+
65+
{ "name": "arm64-apple-clang-debug", "inherits": [ "base", "arm64-apple-clang", "debug" ] },
66+
{ "name": "arm64-apple-clang-release", "inherits": [ "base", "arm64-apple-clang", "reldbg" ] },
67+
{ "name": "arm64-apple-clang+static-release", "inherits": [ "base", "arm64-apple-clang", "reldbg", "static" ] },
68+
69+
{ "name": "arm64-windows-msvc-debug", "inherits": [ "base", "arm64-windows-msvc", "debug" ] },
70+
{ "name": "arm64-windows-msvc-release", "inherits": [ "base", "arm64-windows-msvc", "reldbg" ] },
71+
{ "name": "arm64-windows-msvc+static-release", "inherits": [ "base", "arm64-windows-msvc", "reldbg", "static" ] },
72+
73+
{ "name": "x64-windows-msvc-debug", "inherits": [ "base", "debug" ] },
74+
{ "name": "x64-windows-msvc-release", "inherits": [ "base", "reldbg" ] },
75+
{ "name": "x64-windows-msvc+static-release", "inherits": [ "base", "reldbg", "static" ] },
76+
77+
{ "name": "x64-windows-sycl-debug", "inherits": [ "sycl-base", "debug" ] },
78+
{ "name": "x64-windows-sycl-debug-f16", "inherits": [ "sycl-base", "debug", "sycl_f16" ] },
79+
{ "name": "x64-windows-sycl-release", "inherits": [ "sycl-base", "release" ] },
80+
{ "name": "x64-windows-sycl-release-f16", "inherits": [ "sycl-base", "release", "sycl_f16" ] },
81+
82+
{ "name": "x64-windows-vulkan-debug", "inherits": [ "base", "vulkan", "debug" ] },
83+
{ "name": "x64-windows-vulkan-release", "inherits": [ "base", "vulkan", "release" ] }
84+
]
85+
}

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ BUILD_TARGETS = \
1818
llama-infill \
1919
llama-llava-cli \
2020
llama-minicpmv-cli\
21+
llama-qwen2vl-cli\
2122
llama-lookahead \
2223
llama-lookup \
2324
llama-lookup-create \
@@ -1398,6 +1399,14 @@ llama-minicpmv-cli: examples/llava/minicpmv-cli.cpp \
13981399
$(OBJ_ALL)
13991400
$(CXX) $(CXXFLAGS) $< $(filter-out %.h $<,$^) -o $@ $(LDFLAGS) -Wno-cast-qual
14001401

1402+
llama-qwen2vl-cli: examples/llava/minicpmv-cli.cpp \
1403+
examples/llava/llava.cpp \
1404+
examples/llava/llava.h \
1405+
examples/llava/clip.cpp \
1406+
examples/llava/clip.h \
1407+
$(OBJ_ALL)
1408+
$(CXX) $(CXXFLAGS) $< $(filter-out %.h $<,$^) -o $@ $(LDFLAGS) -Wno-cast-qual
1409+
14011410
ifeq ($(UNAME_S),Darwin)
14021411
swift: examples/batched.swift
14031412
(cd examples/batched.swift; make build)

examples/llava/qwen2vl-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static void process_prompt(struct llava_context * ctx_llava, struct llava_image_
232232
if (image_pos != std::string::npos) {
233233
// new templating mode: Provide the full prompt including system message and use <image> as a placeholder for the image
234234
system_prompt = prompt.substr(0, image_pos);
235-
user_prompt = prompt.substr(image_pos + std::string("<image>").length());
235+
user_prompt = prompt.substr(image_pos + std::string("<|vision_pad|>").length());
236236
LOG_INF("system_prompt: %s\n", system_prompt.c_str());
237237
if (params->verbose_prompt) {
238238
auto tmp = common_tokenize(ctx_llava->ctx_llama, system_prompt, true, true);

0 commit comments

Comments
 (0)