Skip to content

Commit 3ed670b

Browse files
author
Olivier Chafik
committed
Merge remote-tracking branch 'origin/master' into jinja
2 parents 1b3bb7e + bbf3e55 commit 3ed670b

File tree

7 files changed

+52
-42
lines changed

7 files changed

+52
-42
lines changed
9 Bytes
Binary file not shown.

examples/server/webui/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ const VueMarkdown = defineComponent(
111111
highlight: function (str, lang) { // Add highlight.js
112112
if (lang && hljs.getLanguage(lang)) {
113113
try {
114-
return '<pre><code class="hljs">' +
114+
return '<pre dir="auto"><code class="hljs">' +
115115
hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
116116
'</code></pre>';
117117
} catch (__) {}
118118
}
119-
return '<pre><code class="hljs">' + md.value.utils.escapeHtml(str) + '</code></pre>';
119+
return '<pre dir="auto"><code class="hljs">' + md.value.utils.escapeHtml(str) + '</code></pre>';
120120
}
121121
}));
122122
// support latex with double dollar sign and square brackets

scripts/sync-ggml-am.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ while read c; do
7373
src/ggml*.h \
7474
src/ggml*.c \
7575
src/ggml*.cpp \
76+
src/gguf*.cpp \
7677
src/ggml-blas/* \
7778
src/ggml-cann/* \
7879
src/ggml-cpu/* \
@@ -81,10 +82,12 @@ while read c; do
8182
src/ggml-kompute/* \
8283
src/ggml-metal/* \
8384
src/ggml-musa/* \
85+
src/ggml-opencl/* \
8486
src/ggml-rpc/* \
8587
src/ggml-sycl/* \
8688
src/ggml-vulkan/* \
8789
include/ggml*.h \
90+
include/gguf*.h \
8891
tests/test-opt.cpp \
8992
tests/test-quantize-fns.cpp \
9093
tests/test-quantize-perf.cpp \
@@ -123,6 +126,7 @@ if [ -f $SRC_LLAMA/ggml-src.patch ]; then
123126
# src/ggml*.c -> ggml/src/ggml*.c
124127
# src/ggml*.cpp -> ggml/src/ggml*.cpp
125128
# src/ggml*.h -> ggml/src/ggml*.h
129+
# src/gguf*.cpp -> ggml/src/gguf*.cpp
126130
# src/ggml-blas/* -> ggml/src/ggml-blas/*
127131
# src/ggml-cann/* -> ggml/src/ggml-cann/*
128132
# src/ggml-cpu/* -> ggml/src/ggml-cpu/*
@@ -131,11 +135,13 @@ if [ -f $SRC_LLAMA/ggml-src.patch ]; then
131135
# src/ggml-kompute/* -> ggml/src/ggml-kompute/*
132136
# src/ggml-metal/* -> ggml/src/ggml-metal/*
133137
# src/ggml-musa/* -> ggml/src/ggml-musa/*
138+
# src/ggml-opencl/* -> ggml/src/ggml-opencl/*
134139
# src/ggml-rpc/* -> ggml/src/ggml-rpc/*
135140
# src/ggml-sycl/* -> ggml/src/ggml-sycl/*
136141
# src/ggml-vulkan/* -> ggml/src/ggml-vulkan/*
137142
#
138143
# include/ggml*.h -> ggml/include/ggml*.h
144+
# include/gguf*.h -> ggml/include/gguf*.h
139145
#
140146
# tests/test*.cpp -> tests/
141147
#
@@ -149,18 +155,20 @@ if [ -f $SRC_LLAMA/ggml-src.patch ]; then
149155
-e 's/([[:space:]]|[ab]\/)src\/ggml(.*)\.c/\1ggml\/src\/ggml\2.c/g' \
150156
-e 's/([[:space:]]|[ab]\/)src\/ggml(.*)\.cpp/\1ggml\/src\/ggml\2.cpp/g' \
151157
-e 's/([[:space:]]|[ab]\/)src\/ggml(.*)\.h/\1ggml\/src\/ggml\2.h/g' \
158+
-e 's/([[:space:]]|[ab]\/)src\/gguf(.*)\.cpp/\1ggml\/src\/gguf\2.cpp/g' \
152159
-e 's/([[:space:]]|[ab]\/)src\/ggml-blas\//\1ggml\/src\/ggml-blas\//g' \
153160
-e 's/([[:space:]]|[ab]\/)src\/ggml-cann\//\1ggml\/src\/ggml-cann\//g' \
154161
-e 's/([[:space:]]|[ab]\/)src\/ggml-cpu\//\1ggml\/src\/ggml-cpu\//g' \
155162
-e 's/([[:space:]]|[ab]\/)src\/ggml-cuda\//\1ggml\/src\/ggml-cuda\//g' \
156163
-e 's/([[:space:]]|[ab]\/)src\/ggml-hip\//\1ggml\/src\/ggml-hip\//g' \
157164
-e 's/([[:space:]]|[ab]\/)src\/ggml-kompute\//\1ggml\/src\/ggml-kompute\//g' \
158165
-e 's/([[:space:]]|[ab]\/)src\/ggml-metal\//\1ggml\/src\/ggml-metal\//g' \
159-
-e 's/([[:space:]]|[ab]\/)src\/ggml-musa\//\1ggml\/src\/ggml-musa\//g' \
166+
-e 's/([[:space:]]|[ab]\/)src\/ggml-opencl\//\1ggml\/src\/ggml-opencl\//g' \
160167
-e 's/([[:space:]]|[ab]\/)src\/ggml-rpc\//\1ggml\/src\/ggml-rpc\//g' \
161168
-e 's/([[:space:]]|[ab]\/)src\/ggml-sycl\//\1ggml\/src\/ggml-sycl\//g' \
162169
-e 's/([[:space:]]|[ab]\/)src\/ggml-vulkan\//\1ggml\/src\/ggml-vulkan\//g' \
163170
-e 's/([[:space:]]|[ab]\/)include\/ggml(.*)\.h/\1ggml\/include\/ggml\2.h/g' \
171+
-e 's/([[:space:]]|[ab]\/)include\/gguf(.*)\.h/\1ggml\/include\/gguf\2.h/g' \
164172
-e 's/([[:space:]]|[ab]\/)tests\/(.*)\.cpp/\1tests\/\2.cpp/g' \
165173
-e 's/([[:space:]]|[ab]\/)LICENSE/\1LICENSE/g' \
166174
-e 's/([[:space:]]|[ab]\/)scripts\/gen-authors\.sh/\1scripts\/gen-authors.sh/g' \

scripts/sync-ggml.last

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c8bd0fee71dc8328d93be301bbee06bc10d30429
1+
d92321c0d151fe73a47d89738c7c3091ac904297

scripts/sync-ggml.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cp -rpv ../ggml/cmake/FindSIMD.cmake ./ggml/cmake/FindSIMD.cmake
77
cp -rpv ../ggml/src/ggml*.c ./ggml/src/
88
cp -rpv ../ggml/src/ggml*.cpp ./ggml/src/
99
cp -rpv ../ggml/src/ggml*.h ./ggml/src/
10+
cp -rpv ../ggml/src/gguf*.cpp ./ggml/src/
1011
cp -rpv ../ggml/src/ggml-blas/* ./ggml/src/ggml-blas/
1112
cp -rpv ../ggml/src/ggml-cann/* ./ggml/src/ggml-cann/
1213
cp -rpv ../ggml/src/ggml-cpu/* ./ggml/src/ggml-cpu/
@@ -15,11 +16,13 @@ cp -rpv ../ggml/src/ggml-hip/* ./ggml/src/ggml-hip/
1516
cp -rpv ../ggml/src/ggml-kompute/* ./ggml/src/ggml-kompute/
1617
cp -rpv ../ggml/src/ggml-metal/* ./ggml/src/ggml-metal/
1718
cp -rpv ../ggml/src/ggml-musa/* ./ggml/src/ggml-musa/
19+
cp -rpv ../ggml/src/ggml-opencl/* ./ggml/src/ggml-opencl/
1820
cp -rpv ../ggml/src/ggml-rpc/* ./ggml/src/ggml-rpc/
1921
cp -rpv ../ggml/src/ggml-sycl/* ./ggml/src/ggml-sycl/
2022
cp -rpv ../ggml/src/ggml-vulkan/* ./ggml/src/ggml-vulkan/
2123

2224
cp -rpv ../ggml/include/ggml*.h ./ggml/include/
25+
cp -rpv ../ggml/include/gguf*.h ./ggml/include/
2326

2427
cp -rpv ../ggml/tests/test-opt.cpp ./tests/test-opt.cpp
2528
cp -rpv ../ggml/tests/test-quantize-fns.cpp ./tests/test-quantize-fns.cpp

src/llama-vocab.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,8 +1356,9 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
13561356

13571357
// read vocab size from metadata
13581358
uint32_t n_tokens = 0;
1359-
if (!ml.get_key(LLM_KV_VOCAB_SIZE, n_tokens, false)) {
1360-
LLAMA_LOG_WARN("%s: there is no vocab_size in metadata\n", __func__);
1359+
if (ml.get_key(LLM_KV_VOCAB_SIZE, n_tokens, false)) {
1360+
LLAMA_LOG_WARN("%s: adding %u dummy tokens\n", __func__, n_tokens);
1361+
id_to_token.resize(n_tokens);
13611362
}
13621363

13631364
return;

0 commit comments

Comments
 (0)