Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
4b903f08
Unverified
Commit
4b903f08
authored
May 13, 2025
by
Jeffrey Morgan
Committed by
GitHub
May 13, 2025
Browse files
llama: fix crash on snowflake embedding model (#10690)
parent
c7f4ae7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
llama/llama.cpp/src/llama-vocab.cpp
llama/llama.cpp/src/llama-vocab.cpp
+0
-2
llama/patches/0014-fix-string-arr-kv-loading.patch
llama/patches/0014-fix-string-arr-kv-loading.patch
+8
-6
No files found.
llama/llama.cpp/src/llama-vocab.cpp
View file @
4b903f08
...
...
@@ -1469,8 +1469,6 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
const
int
precompiled_charsmap_keyidx
=
gguf_find_key
(
ctx
,
kv
(
LLM_KV_TOKENIZER_PRECOMPILED_CHARSMAP
).
c_str
());
if
(
precompiled_charsmap_keyidx
!=
-
1
)
{
const
gguf_type
pc_type
=
gguf_get_arr_type
(
ctx
,
precompiled_charsmap_keyidx
);
GGML_ASSERT
(
pc_type
==
GGUF_TYPE_INT8
||
pc_type
==
GGUF_TYPE_UINT8
);
const
size_t
n_precompiled_charsmap
=
gguf_get_arr_data_n
(
ctx
,
precompiled_charsmap_keyidx
);
const
char
*
pc
=
(
const
char
*
)
gguf_get_arr_data
(
ctx
,
precompiled_charsmap_keyidx
);
precompiled_charsmap
.
assign
(
pc
,
pc
+
n_precompiled_charsmap
);
...
...
llama/patches/0014-fix-string-arr-kv-loading.patch
View file @
4b903f08
...
...
@@ -9,8 +9,8 @@ such as vocab fields
---
ggml/include/gguf.h | 1 +
ggml/src/gguf.cpp | 7 +++++--
src/llama-vocab.cpp |
2
+-
3 files changed, 7 insertions(+),
3
deletions(-)
src/llama-vocab.cpp |
4
+-
--
3 files changed, 7 insertions(+),
5
deletions(-)
diff --git a/ggml/include/gguf.h b/ggml/include/gguf.h
index 79ee2020..3efb22f0 100644
...
...
@@ -53,13 +53,15 @@ index 381a9c7d..e45b453d 100644
}
diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp
index 10f34d33..
b098bb25
100644
index 10f34d33..
9f5fd57b
100644
--- a/src/llama-vocab.cpp
+++ b/src/llama-vocab.cpp
@@ -1471,7 +1471,7 @@
void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
@@ -1469,9 +1469,7 @@
void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
const int precompiled_charsmap_keyidx = gguf_find_key(ctx, kv(LLM_KV_TOKENIZER_PRECOMPILED_CHARSMAP).c_str());
if (precompiled_charsmap_keyidx != -1) {
const gguf_type pc_type = gguf_get_arr_type(ctx, precompiled_charsmap_keyidx);
GGML_ASSERT(pc_type == GGUF_TYPE_INT8 || pc_type == GGUF_TYPE_UINT8);
-
GGML_ASSERT(pc_type == GGUF_TYPE_INT8 || pc_type == GGUF_TYPE_UINT8);
-
- const size_t n_precompiled_charsmap = gguf_get_arr_n(ctx, precompiled_charsmap_keyidx);
+ const size_t n_precompiled_charsmap = gguf_get_arr_data_n(ctx, precompiled_charsmap_keyidx);
const char * pc = (const char *) gguf_get_arr_data(ctx, precompiled_charsmap_keyidx);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment