From e3e2f5829a871bd9d360470a808921d3c36aa607 Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Thu, 5 Nov 2026 14:48:36 +0200 Subject: [PATCH] Test: Q steer's push is made visible in the tiny model by sharpening its attention (the video moved by rounding only) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Tw9fjV3UWsHHjJiAXix29B --- modules/sampling/q_steer/tests/test_q_steer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/sampling/q_steer/tests/test_q_steer.py b/modules/sampling/q_steer/tests/test_q_steer.py index 692d4241..826aa5c1 100644 --- a/modules/sampling/q_steer/tests/test_q_steer.py +++ b/modules/sampling/q_steer/tests/test_q_steer.py @@ -53,6 +53,11 @@ def test_a_learned_direction_moves_the_picture_and_never_the_sound(tiny_h3): attn = tiny_h3.patcher.model.diffusion_model.blocks[0].attn liked = torch.zeros(attn.heads * attn.head_dim) liked[::attn.head_dim] = 1.0 + # The tiny model's weights are so small that attention is near uniform and a pushed query barely reaches the output + # (its video moved by float rounding only); sharpened attention in the steered block lets the push show. + for block in tiny_h3.patcher.model.diffusion_model.blocks: + for p in block.attn.parameters(): + p.mul_(8) for i, (vec, rating) in enumerate([(liked, "liked"), (-liked, "disliked")] * 2): store.capture("fox", "q_steer", {3: vec}, prompt_id=f"t{i}") store.rate(f"t{i}", rating)