Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/acceptance/test_hooked_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ def test_input_list_of_strings_mlm(our_bert, huggingface_bert, tokenizer):


@pytest.mark.skipif(not torch.cuda.is_available(), reason="Requires a CUDA device")
def test_cuda(mlm_tokens):
def test_cuda(tokens):
model = HookedEncoder.from_pretrained(MODEL_NAME)
model(mlm_tokens)
model(tokens)
3 changes: 2 additions & 1 deletion tests/unit/pretrained_weight_conversions/test_apertus.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def make_cfg(use_qk_norm=True, n_key_value_heads=4):
use_qk_norm=use_qk_norm,
n_key_value_heads=n_key_value_heads,
dtype=torch.float32,
device="cpu",
)


Expand Down Expand Up @@ -183,7 +184,7 @@ def test_zero_biases_have_correct_device(self):
"blocks.0.mlp.b_out",
"unembed.b_U",
]:
assert sd[key].device.type == cfg.device.type, f"{key} on wrong device"
assert sd[key].device.type == cfg.device, f"{key} on wrong device"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove .type since cfg.device is a str now. There's a pre-existing type issue here since cfg.device has type str | None so the old code shouldn't have compiled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1230


def test_unembed_shapes(self):
cfg = make_cfg()
Expand Down
Loading