mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-09-24 20:20:37 +00:00
fix: match exact weights in LLM config detection (#1923)
This commit is contained in:
parent
be0e34480d
commit
2c929495ab
@ -232,12 +232,12 @@ namespace LLM {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (contains(name, "visual.blocks.0.mlp.linear_fc1.weight") ||
|
if (ends_with(name, "visual.blocks.0.mlp.linear_fc1.weight") ||
|
||||||
contains(name, "visual.blocks.0.mlp.gate_proj.weight")) {
|
ends_with(name, "visual.blocks.0.mlp.gate_proj.weight")) {
|
||||||
config.vision.intermediate_size = tensor_storage.ne[1];
|
config.vision.intermediate_size = tensor_storage.ne[1];
|
||||||
}
|
}
|
||||||
if (contains(name, "visual.merger.linear_fc2.weight") ||
|
if (ends_with(name, "visual.merger.linear_fc2.weight") ||
|
||||||
contains(name, "visual.merger.mlp.2.weight")) {
|
ends_with(name, "visual.merger.mlp.2.weight")) {
|
||||||
config.vision.out_hidden_size = tensor_storage.ne[1];
|
config.vision.out_hidden_size = tensor_storage.ne[1];
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -256,13 +256,13 @@ namespace LLM {
|
|||||||
config.hidden_size = tensor_storage.ne[0];
|
config.hidden_size = tensor_storage.ne[0];
|
||||||
config.vocab_size = tensor_storage.ne[1];
|
config.vocab_size = tensor_storage.ne[1];
|
||||||
}
|
}
|
||||||
if (contains(name, "layers.0.mlp.gate_proj.weight")) {
|
if (ends_with(name, "layers.0.mlp.gate_proj.weight")) {
|
||||||
config.intermediate_size = tensor_storage.ne[1];
|
config.intermediate_size = tensor_storage.ne[1];
|
||||||
}
|
}
|
||||||
if (contains(name, "layers.0.mlp.experts.gate_up_proj.weight")) {
|
if (ends_with(name, "layers.0.mlp.experts.gate_up_proj.weight")) {
|
||||||
config.intermediate_size = tensor_storage.ne[1] / 2;
|
config.intermediate_size = tensor_storage.ne[1] / 2;
|
||||||
}
|
}
|
||||||
if (contains(name, "layers.0.mlp.experts.gate_proj.weight")) {
|
if (ends_with(name, "layers.0.mlp.experts.gate_proj.weight")) {
|
||||||
config.intermediate_size = tensor_storage.ne[1];
|
config.intermediate_size = tensor_storage.ne[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user