Skip to content

Commit

Permalink
Model: hotfix for broken tensor names in flux unchained
Browse files Browse the repository at this point in the history
  • Loading branch information
stduhpf committed Oct 7, 2024
1 parent 14206fd commit 255f95a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,8 +1669,13 @@ bool ModelLoader::load_tensors(std::map<std::string, struct ggml_tensor*>& tenso
std::set<std::string> ignore_tensors) {
std::set<std::string> tensor_names_in_file;
auto on_new_tensor_cb = [&](const TensorStorage& tensor_storage, ggml_tensor** dst_tensor) -> bool {
const std::string& name = tensor_storage.name;
std::string name = tensor_storage.name;
// LOG_DEBUG("%s", tensor_storage.to_string().c_str());
if (starts_with(name, "model.diffusion_model.model.diffusion_model")) {
LOG_WARN("Tensor %s has duplicated 'model.diffusion_model', attempting dirty fix...", name.c_str());
name = name.substr(strlen("model.diffusion_model."));
}

tensor_names_in_file.insert(name);

struct ggml_tensor* real;
Expand Down

0 comments on commit 255f95a

Please sign in to comment.