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
714adb8b
"clients/python/tests_native/test_client.py" did not exist on "2d56f106a60c7b698705494e7539f8a7e4c85dd9"
Unverified
Commit
714adb8b
authored
May 23, 2024
by
Michael Yang
Committed by
GitHub
May 23, 2024
Browse files
bump (#4597)
parent
95b1133d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
8 deletions
+56
-8
llm/ext_server/server.cpp
llm/ext_server/server.cpp
+2
-2
llm/llama.cpp
llm/llama.cpp
+1
-1
llm/patches/03-load_exception.diff
llm/patches/03-load_exception.diff
+18
-5
llm/patches/05-default-pretokenizer.diff
llm/patches/05-default-pretokenizer.diff
+35
-0
No files found.
llm/ext_server/server.cpp
View file @
714adb8b
...
@@ -738,7 +738,7 @@ struct llama_server_context
...
@@ -738,7 +738,7 @@ struct llama_server_context
sampler_names
.
emplace_back
(
sampler_name
);
sampler_names
.
emplace_back
(
sampler_name
);
}
}
}
}
slot
->
sparams
.
samplers_sequence
=
sampl
er
_types_from_names
(
sampler_names
,
false
);
slot
->
sparams
.
samplers_sequence
=
llama_
sampl
ing
_types_from_names
(
sampler_names
,
false
);
}
}
else
else
{
{
...
@@ -1096,7 +1096,7 @@ struct llama_server_context
...
@@ -1096,7 +1096,7 @@ struct llama_server_context
std
::
vector
<
std
::
string
>
samplers_sequence
;
std
::
vector
<
std
::
string
>
samplers_sequence
;
for
(
const
auto
&
sampler_type
:
slot
.
sparams
.
samplers_sequence
)
for
(
const
auto
&
sampler_type
:
slot
.
sparams
.
samplers_sequence
)
{
{
samplers_sequence
.
emplace_back
(
sampl
er
_type_to_
name_string
(
sampler_type
));
samplers_sequence
.
emplace_back
(
llama_
sampl
ing
_type_to_
str
(
sampler_type
));
}
}
return
json
{
return
json
{
...
...
llama.cpp
@
74f33adf
Compare
614d3b91
...
74f33adf
Subproject commit
614d3b914e1c3e02596f869649eb4f1d3b68614d
Subproject commit
74f33adf5f8b20b08fc5a6aa17ce081abe86ef2f
llm/patches/03-load_exception.diff
View file @
714adb8b
From 544a2d2e646d39e878d87dfbb3398a356bc560ab Mon Sep 17 00:00:00 2001
From: Michael Yang <mxyng@pm.me>
Date: Thu, 23 May 2024 11:18:45 -0700
Subject: [PATCH] throw exception on load errors
---
llama.cpp | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/llama.cpp b/llama.cpp
diff --git a/llama.cpp b/llama.cpp
index
4225f955..7b762f86
100644
index
15c66077..8ba90b6a
100644
--- a/llama.cpp
--- a/llama.cpp
+++ b/llama.cpp
+++ b/llama.cpp
@@ -
475
6,7 +
475
6,7 @@
static int llama_model_load(const std::string & fname, llama_model & model, llam
@@ -
634
6,7 +
634
6,7 @@
static int llama_model_load(const std::string & fname, llama_model & model, llam
}
}
} catch (const std::exception & err) {
} catch (const std::exception & err) {
LLAMA_LOG_ERROR("%s: error loading model: %s\n", __func__, err.what());
LLAMA_LOG_ERROR("%s: error loading model: %s\n", __func__, err.what());
...
@@ -11,10 +20,10 @@ index 4225f955..7b762f86 100644
...
@@ -11,10 +20,10 @@ index 4225f955..7b762f86 100644
}
}
return 0;
return 0;
@@ -12102,16 +12102,22 @@
struct llama_model * llama_load_model_from_file(
@@ -15600,16 +15600,23 @@
struct llama_model * llama_load_model_from_file(
};
}
model->rpc_servers.push_back(servers);
}
}
- int status = llama_model_load(path_model, *model, params);
- int status = llama_model_load(path_model, *model, params);
- GGML_ASSERT(status <= 0);
- GGML_ASSERT(status <= 0);
- if (status < 0) {
- if (status < 0) {
...
@@ -22,6 +31,7 @@ index 4225f955..7b762f86 100644
...
@@ -22,6 +31,7 @@ index 4225f955..7b762f86 100644
- LLAMA_LOG_ERROR("%s: failed to load model\n", __func__);
- LLAMA_LOG_ERROR("%s: failed to load model\n", __func__);
- } else if (status == -2) {
- } else if (status == -2) {
- LLAMA_LOG_INFO("%s: cancelled model load\n", __func__);
- LLAMA_LOG_INFO("%s: cancelled model load\n", __func__);
+
+ try {
+ try {
+ int status = llama_model_load(path_model, *model, params);
+ int status = llama_model_load(path_model, *model, params);
+ GGML_ASSERT(status <= 0);
+ GGML_ASSERT(status <= 0);
...
@@ -42,3 +52,6 @@ index 4225f955..7b762f86 100644
...
@@ -42,3 +52,6 @@ index 4225f955..7b762f86 100644
}
}
return model;
return model;
--
2.45.1
llm/patches/05-default-pretokenizer.diff
0 → 100644
View file @
714adb8b
From d02a06f3f45a09255ace8684a66590e06ce44605 Mon Sep 17 00:00:00 2001
From: Michael Yang <mxyng@pm.me>
Date: Thu, 23 May 2024 11:33:20 -0700
Subject: [PATCH] default pretokenizer on unrecognized type
---
llama.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/llama.cpp b/llama.cpp
index 15c66077..af1aede3 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -4504,9 +4504,6 @@
static void llm_load_vocab(
LLAMA_LOG_WARN("%s: ************************************ \n", __func__);
LLAMA_LOG_WARN("%s: \n", __func__);
vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
- } else if (
- tokenizer_pre == "default") {
- vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
} else if (
tokenizer_pre == "llama3" ||
tokenizer_pre == "llama-v3" ||
@@ -4553,7 +4550,7 @@
static void llm_load_vocab(
tokenizer_pre == "dbrx") {
vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DBRX;
} else {
- throw std::runtime_error(format("unknown pre-tokenizer type: '%s'", tokenizer_pre.c_str()));
+ vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
}
} else {
vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
--
2.45.1
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