update scale value

This commit is contained in:
leejet 2026-06-06 15:52:04 +08:00
parent 14d7e4f042
commit 6e25a18394
2 changed files with 3 additions and 3 deletions

View File

@ -3380,10 +3380,10 @@ public:
forward_params.linear.scale = scale; forward_params.linear.scale = scale;
out = ctx->weight_adapter->forward_with_lora(ctx->ggml_ctx, ctx->backend, x, w, linear_bias, prefix, forward_params); out = ctx->weight_adapter->forward_with_lora(ctx->ggml_ctx, ctx->backend, x, w, linear_bias, prefix, forward_params);
} else { } else {
out = ggml_ext_linear(ctx->ggml_ctx, x, w, linear_bias, force_prec_f32, 1 / 128.f); out = ggml_ext_linear(ctx->ggml_ctx, x, w, linear_bias, force_prec_f32, scale);
} }
if (has_weight_scale) { if (has_weight_scale) {
out = ggml_mul(ctx->ggml_ctx, out, params["weight_scale"]); out = ggml_mul(ctx->ggml_ctx, out, params["weight_scale"]);
if (b != nullptr) { if (b != nullptr) {
out = ggml_add_inplace(ctx->ggml_ctx, out, b); out = ggml_add_inplace(ctx->ggml_ctx, out, b);
} }

View File

@ -181,7 +181,7 @@ namespace Ideogram4 {
q = norm_q->forward(ctx, q); q = norm_q->forward(ctx, q);
k = norm_k->forward(ctx, k); k = norm_k->forward(ctx, k);
x = Rope::attention(ctx, q, k, v, pe, mask, 1.f / std::sqrt(static_cast<float>(head_dim)), false); x = Rope::attention(ctx, q, k, v, pe, mask, 1.f / 128.f, false);
x = out_proj->forward(ctx, x); x = out_proj->forward(ctx, x);
return x; return x;
} }