Skip to content

Commit

Permalink
Add ESMFold code sample (#20000)
Browse files Browse the repository at this point in the history
* Add ESMFold code sample

* sorry sylvain

* make fixup

* sorry sylvain again
  • Loading branch information
Rocketknight1 authored and sgugger committed Nov 1, 2022
1 parent 502d3b6 commit 8f95346
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/transformers/models/esm/modeling_esmfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@


logger = logging.get_logger(__name__)
_CHECKPOINT_FOR_DOC = "Rocketknight1/esmfold_v1"
_CONFIG_FOR_DOC = "EsmConfig"
_TOKENIZER_FOR_DOC = "EsmTokenizer"


@dataclass
Expand Down Expand Up @@ -2092,7 +2095,16 @@ def forward(
Example:
TODO Matt
```python
>>> from transformers import AutoTokenizer, EsmForProteinFolding
>>> model = EsmForProteinFolding.from_pretrained("facebook/esmfold_v1")
>>> tokenizer = AutoTokenizer.from_pretrained("facebook/esmfold_v1")
>>> inputs = tokenizer(["MLKNVQVQLV"], return_tensors="pt") # A tiny random peptide
>>> outputs = model(**inputs)
>>> folded_positions = outputs.positions
```
"""
cfg = self.config.esmfold_config

Expand Down

0 comments on commit 8f95346

Please sign in to comment.