mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2025-12-13 05:48:56 +00:00
update to latest ggml
This commit is contained in:
parent
00b0a0053d
commit
2570565dfa
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
||||
[submodule "ggml"]
|
||||
path = ggml
|
||||
url = https://github.com/leejet/ggml.git
|
||||
url = https://github.com/ggml-org/ggml.git
|
||||
|
||||
2
ggml
2
ggml
@ -1 +1 @@
|
||||
Subproject commit 70268874234fa06cf058739a221bfbe94129f330
|
||||
Subproject commit 5fdc78fff274094e2a1b155928131983362d8a71
|
||||
16
model.cpp
16
model.cpp
@ -1055,21 +1055,7 @@ bool ModelLoader::init_from_gguf_file(const std::string& file_path, const std::s
|
||||
gguf_context* ctx_gguf_ = NULL;
|
||||
ggml_context* ctx_meta_ = NULL;
|
||||
|
||||
auto on_tensor_shape_read = [](const int64_t* ne, uint32_t n_dims, struct gguf_tensor_shape* shape) -> bool {
|
||||
for (int i = 0; i < GGML_MAX_DIMS; i++) {
|
||||
if (i < n_dims) {
|
||||
shape->ne[i] = ne[i];
|
||||
} else {
|
||||
shape->ne[i] = 1;
|
||||
}
|
||||
}
|
||||
for (int i = GGML_MAX_DIMS; i < n_dims; i++) {
|
||||
shape->ne[GGML_MAX_DIMS - 1] *= ne[i]; // stack to last dim;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
ctx_gguf_ = gguf_init_from_file_ext(file_path.c_str(), {true, &ctx_meta_}, on_tensor_shape_read);
|
||||
ctx_gguf_ = gguf_init_from_file(file_path.c_str(), {true, &ctx_meta_});
|
||||
if (!ctx_gguf_) {
|
||||
LOG_ERROR("failed to open '%s'", file_path.c_str());
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user