Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
4f1e5e4e
Unverified
Commit
4f1e5e4e
authored
Nov 01, 2022
by
Matt
Committed by
GitHub
Nov 01, 2022
Browse files
Add ESMFold code sample (#20000)
* Add ESMFold code sample * sorry sylvain * make fixup * sorry sylvain again
parent
38e5b71a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
src/transformers/models/esm/modeling_esmfold.py
src/transformers/models/esm/modeling_esmfold.py
+13
-1
No files found.
src/transformers/models/esm/modeling_esmfold.py
View file @
4f1e5e4e
...
...
@@ -52,6 +52,9 @@ from .openfold_utils import (
logger
=
logging
.
get_logger
(
__name__
)
_CHECKPOINT_FOR_DOC
=
"Rocketknight1/esmfold_v1"
_CONFIG_FOR_DOC
=
"EsmConfig"
_TOKENIZER_FOR_DOC
=
"EsmTokenizer"
@
dataclass
...
...
@@ -2092,7 +2095,16 @@ class EsmForProteinFolding(EsmPreTrainedModel):
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment