Update README.md
Browse files
README.md
CHANGED
@@ -42,21 +42,18 @@ Extract interpretable features from protein sequences:
|
|
42 |
|
43 |
```python
|
44 |
from interplm.sae.inference import load_sae_from_hf
|
45 |
-
from interplm.esm.embed import
|
46 |
-
|
47 |
-
#
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
# Extract features
|
59 |
-
features = sae.encode(protein_embeddings)
|
60 |
```
|
61 |
|
62 |
For detailed training and analysis examples, see the [GitHub README](https://github.com/ElanaPearl/InterPLM/blob/main/README.md).
|
|
|
42 |
|
43 |
```python
|
44 |
from interplm.sae.inference import load_sae_from_hf
|
45 |
+
from interplm.esm.embed import embed_single_sequence
|
46 |
+
|
47 |
+
# Get ESM embeddings for protein sequence
|
48 |
+
embeddings = embed_single_sequence(
|
49 |
+
sequence="MRWQEMGYIFYPRKLR",
|
50 |
+
model_name="esm2_t6_8M_UR50D",
|
51 |
+
layer=4 # Choose ESM layer (1-6)
|
52 |
+
)
|
53 |
+
|
54 |
+
# Load SAE model and extract features
|
55 |
+
sae = load_sae_from_hf(plm_model="esm2-8m", plm_layer=4)
|
56 |
+
features = sae.encode(embeddings)
|
|
|
|
|
|
|
57 |
```
|
58 |
|
59 |
For detailed training and analysis examples, see the [GitHub README](https://github.com/ElanaPearl/InterPLM/blob/main/README.md).
|