mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-09-24 20:20:37 +00:00
fix: add graph cuts for MiniMax-H3 text conditioning (#1900)
This commit is contained in:
parent
2dc7f5408a
commit
36746936c0
@ -264,6 +264,9 @@ namespace MiniMaxH3 {
|
||||
for (int64_t i = 0; i < num_layers; ++i) {
|
||||
auto block = std::dynamic_pointer_cast<TokenRefinerBlock>(blocks["blocks." + std::to_string(i)]);
|
||||
x = block->forward(ctx, x);
|
||||
sd::ggml_graph_cut::mark_graph_cut(x,
|
||||
"minimax_h3.token_refiner.blocks." + std::to_string(i),
|
||||
"hidden_states");
|
||||
}
|
||||
return std::dynamic_pointer_cast<RMSNorm>(blocks["final_norm"])->forward(ctx, x);
|
||||
}
|
||||
@ -527,7 +530,11 @@ namespace MiniMaxH3 {
|
||||
GGML_ASSERT(context->ne[0] == config.text_dim);
|
||||
auto condition_proj = std::dynamic_pointer_cast<Linear>(blocks["condition_proj"]);
|
||||
auto token_refiner = std::dynamic_pointer_cast<TokenRefiner>(blocks["token_refiner"]);
|
||||
return token_refiner->forward(ctx, condition_proj->forward(ctx, context));
|
||||
auto projected = condition_proj->forward(ctx, context);
|
||||
sd::ggml_graph_cut::mark_graph_cut(projected,
|
||||
"minimax_h3.condition_proj",
|
||||
"hidden_states");
|
||||
return token_refiner->forward(ctx, projected);
|
||||
}
|
||||
|
||||
ggml_tensor* time_embedding(GGMLRunnerContext* ctx,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user