Skip to content

Commit 33eeb5a

Browse files
committed
docs: add installation guide
1 parent 4a48977 commit 33eeb5a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ XLens is designed for mechanistic interpretability of Transformer language model
1616
- **Full Type Annotations:** Comprehensive type annotations with generics and [jaxtyping](https://github.com/patrick-kidger/jaxtyping) for better code completion and type checking.
1717
- **Intuitive API:** Designed with ease of use in mind, facilitating quick experimentation and exploration.
1818

19+
## Installation
20+
21+
XLens can be installed via pip:
22+
23+
```bash
24+
pip install xlens
25+
```
26+
1927
## Examples
2028

2129
Here are some basic examples to get you started with XLens.
@@ -31,7 +39,7 @@ tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
3139
model = HookedTransformer.from_pretrained("meta-llama/Llama-3.2-1B")
3240

3341
# Capture the activations of the model
34-
inputs = tokenizer("Hello, world!", return_tensors="jax")
42+
inputs = tokenizer("Hello, world!", return_tensors="np")
3543
logits, cache = model.run_with_cache(**inputs, hook_names=["blocks.0.hook_attn_out"])
3644
print(cache["blocks.0.hook_attn_out"].shape) # (1, 5, 2048)
3745
```

0 commit comments

Comments
 (0)