remove tensor renaming; fixing names in the photomaker model file

This commit is contained in:
bssrdf
2024-02-26 14:37:04 -05:00
parent 77b6a42bc3
commit 464f1f8d8b
4 changed files with 6 additions and 16 deletions

View File

@@ -828,17 +828,7 @@ bool ModelLoader::init_from_safetensors_file(const std::string& file_path, const
return false;
}
}
// fix photomaker model file to remove the following name fix
size_t pos = name.find("layrnorm");
if(pos != std::string::npos){
name.replace(pos, strlen("layrnorm"), "layernorm");
}
if(starts_with(prefix, "pmid")){
pos = name.find("visual_projection.w");
if(pos != std::string::npos){
name.replace(0, 0, "vision_model.");
}
}
TensorStorage tensor_storage(prefix + name, type, ne, n_dims, file_index, ST_HEADER_SIZE_LEN + header_size_ + begin);
tensor_storage.reverse_ne();