Skip to content

Commit 6018ed8

Browse files
authored
Format Python code blocks in Markdown so ruff format --check passes (#112)
ruff 0.16.0 began formatting Python code blocks inside Markdown files. The `dev` extra declares `ruff>=0.12.7` with no upper bound, so CI installs a ruff that applies this, and the `check formatting` step now fails on two files that have not otherwise changed. Because that step is first, it also gates linting, type checking and the test suite, so builds stop before any of them run. Reformats the two affected blocks only: a quote style in README.md and a wrapped type annotation in circuit_tracer/utils/MAPPING_INFO.md. No prose, no code semantics, and no public surface changes.
1 parent 8f1e243 commit 6018ed8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ In order to use the `lazy_decoder` and `lazy_encoder` options on transcoders, th
6868
from circuit_tracer.utils.caching import save_transcoders_to_cache
6969

7070
hf_ref = "mwhanna/gemma-scope-2-27b-pt/transcoder_all/width_262k_l0_small"
71-
cache_dir = '~/.cache/'
71+
cache_dir = "~/.cache/"
7272
save_transcoders_to_cache(hf_ref, cache_dir=cache_dir)
7373
```
7474

‎circuit_tracer/utils/MAPPING_INFO.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class TransformerLens_NNSight_Mapping:
1212
embed_location: str # Location of the embedding Module (the location to which we will attribute for embeddings)
1313
embed_weight: str # Location of the embedding weight matrix
1414
unembed_weight: str # Location of the unembedding weight matrix
15-
feature_hook_mapping: dict[str, tuple[str, Literal['input', 'output']]] # Mapping from (TransformerLens Hook) to a tuple representing an NNSight Envoy location, and whether we want its input or output
15+
feature_hook_mapping: dict[
16+
str, tuple[str, Literal["input", "output"]]
17+
] # Mapping from (TransformerLens Hook) to a tuple representing an NNSight Envoy location, and whether we want its input or output
1618
```
1719

1820
The values of the location / pattern fields are the NNSight locations whose outputs we need to access or freeze. For example, if `embed_location="model.embed_tokens"`, this means that `model.model.embed_tokens` is the location of the embeddings, and `model.model.embed_tokens.output` will fetch its output.

0 commit comments

Comments
 (0)