Skip to content

Commit

Permalink
chore: bump vendors
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed Jan 14, 2025
1 parent 5fdbd92 commit a551909
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
[submodule "stable-diffusion.cpp"]
path = stable-diffusion.cpp
url = https://github.com/thxcode/stable-diffusion.cpp
branch = dev-dcf91f9e
branch = dev-dcf91f9e-2
4 changes: 2 additions & 2 deletions llama-box/patches/llama.cpp/mrope.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/common/common.cpp b/common/common.cpp
index 1a2e1524..f1bbe39e 100644
index a6f9252b..e16beb15 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -886,6 +886,11 @@ struct common_init_result common_init_from_params(common_params & params) {
@@ -902,6 +902,11 @@ struct common_init_result common_init_from_params(common_params & params) {

auto cparams = common_context_params_to_llama(params);

Expand Down
22 changes: 11 additions & 11 deletions llama-box/patches/llama.cpp/tool_calling.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/common/common.cpp b/common/common.cpp
index 1a2e1524..8162df9d 100644
index a6f9252b..ffdc5388 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -1642,13 +1642,15 @@ std::string common_get_builtin_chat_template(const struct llama_model * model) {
@@ -1736,13 +1736,15 @@ std::string common_get_builtin_chat_template(const struct llama_model * model) {

bool common_chat_verify_template(const std::string & tmpl) {
llama_chat_message chat[] = {{"user", "test"}};
Expand All @@ -19,7 +19,7 @@ index 1a2e1524..8162df9d 100644
bool add_ass) {
int alloc_size = 0;
bool fallback = false; // indicate if we must fallback to default chatml
@@ -1657,12 +1659,17 @@ std::string common_chat_apply_template(const struct llama_model * model,
@@ -1751,12 +1753,17 @@ std::string common_chat_apply_template(const struct llama_model * model,
chat.push_back({msg.role.c_str(), msg.content.c_str()});
alloc_size += (msg.role.size() + msg.content.size()) * 1.25;
}
Expand All @@ -38,7 +38,7 @@ index 1a2e1524..8162df9d 100644

// error: chat template is not supported
if (res < 0) {
@@ -1673,7 +1680,7 @@ std::string common_chat_apply_template(const struct llama_model * model,
@@ -1767,7 +1774,7 @@ std::string common_chat_apply_template(const struct llama_model * model,
}

// If the built-in template is not supported, we default to chatml
Expand All @@ -47,7 +47,7 @@ index 1a2e1524..8162df9d 100644
fallback = true;
}

@@ -1681,8 +1688,9 @@ std::string common_chat_apply_template(const struct llama_model * model,
@@ -1775,8 +1782,9 @@ std::string common_chat_apply_template(const struct llama_model * model,
if ((size_t) res > buf.size()) {
buf.resize(res);
res = llama_chat_apply_template(
Expand All @@ -58,7 +58,7 @@ index 1a2e1524..8162df9d 100644
}

std::string formatted_chat(buf.data(), res);
@@ -1695,7 +1703,7 @@ std::string common_chat_format_single(const struct llama_model * model,
@@ -1789,7 +1797,7 @@ std::string common_chat_format_single(const struct llama_model * model,
const common_chat_msg & new_msg,
bool add_ass) {
std::ostringstream ss;
Expand All @@ -67,7 +67,7 @@ index 1a2e1524..8162df9d 100644
std::vector<common_chat_msg> chat_new(past_msg);
// if the past_msg ends with a newline, we must preserve it in the formatted version
if (add_ass && !fmt_past_msg.empty() && fmt_past_msg.back() == '\n') {
@@ -1703,7 +1711,7 @@ std::string common_chat_format_single(const struct llama_model * model,
@@ -1797,7 +1805,7 @@ std::string common_chat_format_single(const struct llama_model * model,
};
// format chat with new_msg
chat_new.push_back(new_msg);
Expand All @@ -76,7 +76,7 @@ index 1a2e1524..8162df9d 100644
// get the diff part
ss << fmt_new_msg.substr(fmt_past_msg.size(), fmt_new_msg.size() - fmt_past_msg.size());
return ss.str();
@@ -1712,12 +1720,16 @@ std::string common_chat_format_single(const struct llama_model * model,
@@ -1806,12 +1814,16 @@ std::string common_chat_format_single(const struct llama_model * model,
std::string common_chat_format_example(const struct llama_model * model,
const std::string & tmpl) {
std::vector<common_chat_msg> msgs = {
Expand All @@ -99,10 +99,10 @@ index 1a2e1524..8162df9d 100644

//
diff --git a/common/common.h b/common/common.h
index d523948b..e251f1b5 100644
index c86a4ef3..14acb5ad 100644
--- a/common/common.h
+++ b/common/common.h
@@ -575,6 +575,13 @@ std::string common_detokenize(
@@ -583,6 +583,13 @@ std::string common_detokenize(
// Chat template utils
//

Expand All @@ -116,7 +116,7 @@ index d523948b..e251f1b5 100644
// same with llama_chat_message, but uses std::string
struct common_chat_msg {
std::string role;
@@ -593,6 +600,8 @@ bool common_chat_verify_template(const std::string & tmpl);
@@ -601,6 +608,8 @@ bool common_chat_verify_template(const std::string & tmpl);
std::string common_chat_apply_template(const struct llama_model * model,
const std::string & tmpl,
const std::vector<common_chat_msg> & chat,
Expand Down
2 changes: 1 addition & 1 deletion llama-box/patches/llama.cpp/vocab.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ index a184884c..ec814882 100644
LLAMA_API bool llama_vocab_get_add_bos(const struct llama_vocab * vocab);
LLAMA_API bool llama_vocab_get_add_eos(const struct llama_vocab * vocab);
diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp
index d0fb85ce..738b1b15 100644
index 96b74e93..c57a8648 100644
--- a/src/llama-vocab.cpp
+++ b/src/llama-vocab.cpp
@@ -1586,7 +1586,8 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
Expand Down
2 changes: 1 addition & 1 deletion stable-diffusion.cpp

0 comments on commit a551909

Please sign in to comment.