mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 03:24:30 +00:00
refactor: replace manual gated activations with native ggml GLU (#2250)
This commit is contained in:
1 parent
37bc88b5e9
commit
e239e4b0fd
13 files changed
+33
-53
No files matched your search
@@ -204,9 +204,8 @@ namespace ErnieImage {
|
||||
auto linear_fc2 = std::dynamic_pointer_cast<Linear>(blocks["linear_fc2"]);
|
||||
|
||||
auto gate = gate_proj->forward(ctx, x);
|
||||
gate = ggml_ext_gelu(ctx->ggml_ctx, gate);
|
||||
x = up_proj->forward(ctx, x);
|
||||
x = ggml_mul(ctx->ggml_ctx, x, gate);
|
||||
x = ggml_geglu_split(ctx->ggml_ctx, gate, x);
|
||||
x = linear_fc2->forward(ctx, x);
|
||||
return x;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user