Skip to content

Commit a04bd43

Browse files
committed
add CI tests
1 parent 917661d commit a04bd43

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install ".[dev]"
24+
25+
- name: Run tests
26+
run: pytest

delphi/sparse_coders/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def load_sparse_coders(
2828

2929
# Add SAE hooks to the model
3030
if "gemma" not in run_cfg.sparse_model:
31-
hookpoint_to_sae_encode = load_sparsify_sparse_coders(
31+
hookpoint_to_sparse_encode = load_sparsify_sparse_coders(
3232
model,
3333
run_cfg.sparse_model,
3434
run_cfg.hookpoints,
@@ -54,7 +54,7 @@ def load_sparse_coders(
5454
sae_sizes.append(sae_size)
5555
l0s.append(l0)
5656

57-
hookpoint_to_sae_encode = load_gemma_autoencoders(
57+
hookpoint_to_sparse_encode = load_gemma_autoencoders(
5858
model_path=model_path,
5959
ae_layers=layers,
6060
average_l0s=l0s,
@@ -64,4 +64,4 @@ def load_sparse_coders(
6464
device=model.device,
6565
)
6666

67-
return hookpoint_to_sae_encode
67+
return hookpoint_to_sparse_encode

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ dependencies = [
2525
"sentence_transformers"
2626
]
2727

28+
[project.optional-dependencies]
29+
dev = ["pytest"]
30+
2831
[tool.pyright]
2932
include = ["delphi*"]
3033
reportPrivateImportUsage = false

0 commit comments

Comments
 (0)