diff --git a/conditioner.hpp b/conditioner.hpp index 0d58ffd..a4e84aa 100644 --- a/conditioner.hpp +++ b/conditioner.hpp @@ -1798,7 +1798,7 @@ struct LLMEmbedder : public Conditioner { prompt += "<|im_end|>\n<|im_start|>assistant\n"; } else if (version == VERSION_FLUX2_KLEIN) { prompt_template_encode_start_idx = 0; - max_length = 512; + max_length = 512; out_layers = {9, 18, 27}; prompt = "<|im_start|>user\n"; @@ -1810,8 +1810,8 @@ struct LLMEmbedder : public Conditioner { prompt += "<|im_end|>\n<|im_start|>assistant\n\n\n\n\n"; auto tokens_and_weights = tokenize(prompt, prompt_attn_range, 0, false); - tokens = std::get<0>(tokens_and_weights); - weights = std::get<1>(tokens_and_weights); + tokens = std::get<0>(tokens_and_weights); + weights = std::get<1>(tokens_and_weights); mask.insert(mask.end(), tokens.size(), 1.f); if (tokens.size() < max_length) { @@ -1843,8 +1843,8 @@ struct LLMEmbedder : public Conditioner { if (tokens.empty()) { auto tokens_and_weights = tokenize(prompt, prompt_attn_range, max_length, max_length > 0); - tokens = std::get<0>(tokens_and_weights); - weights = std::get<1>(tokens_and_weights); + tokens = std::get<0>(tokens_and_weights); + weights = std::get<1>(tokens_and_weights); } int64_t t0 = ggml_time_ms(); diff --git a/flux.hpp b/flux.hpp index 6ac4731..9826fad 100644 --- a/flux.hpp +++ b/flux.hpp @@ -1352,7 +1352,7 @@ namespace Flux { } } - flux_params.num_heads = static_cast(flux_params.hidden_size / head_dim); + flux_params.num_heads = static_cast(flux_params.hidden_size / head_dim); LOG_INFO("flux: depth = %d, depth_single_blocks = %d, guidance_embed = %s, context_in_dim = %" PRId64 ", hidden_size = %" PRId64 ", num_heads = %d", diff --git a/ggml_extend.hpp b/ggml_extend.hpp index 24b3831..bf95e33 100644 --- a/ggml_extend.hpp +++ b/ggml_extend.hpp @@ -1349,7 +1349,7 @@ __STATIC_INLINE__ struct ggml_tensor* ggml_ext_attention_ext(struct ggml_context auto kq = ggml_mul_mat(ctx, k, q); // [N * n_head, L_q, L_k] ggml_mul_mat_set_prec(kq, GGML_PREC_F32); - kq = ggml_scale_inplace(ctx, kq, scale); + kq = ggml_scale_inplace(ctx, kq, scale); if (mask) { kq = ggml_add_inplace(ctx, kq, mask); }