Transformers
Safetensors
English
esmfold2
biology
esm
protein
protein-structure-prediction
structure-prediction
protein-design
3d-structure
confidence-estimation
molecular-dynamics
custom_code
Instructions to use biohub/ESMFold2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use biohub/ESMFold2 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("biohub/ESMFold2", trust_remote_code=True) model = AutoModel.from_pretrained("biohub/ESMFold2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -45,22 +45,22 @@ Refer to the [paper](https://www.biorxiv.org/content/10.64898/2026.06.03.729735)
|
|
| 45 |
|
| 46 |
### Usage
|
| 47 |
|
| 48 |
-
Please install `esm` from
|
| 49 |
|
| 50 |
```
|
| 51 |
-
pip install esm
|
| 52 |
```
|
| 53 |
|
| 54 |
You can fold your first protein with:
|
| 55 |
|
| 56 |
```py
|
| 57 |
-
from transformers.models.esmfold2.modeling_esmfold2 import
|
| 58 |
|
| 59 |
# Ubiquitin (PDB 1UBQ)
|
| 60 |
sequence = "MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG"
|
| 61 |
|
| 62 |
# optionally use "biohub/ESMFold2"
|
| 63 |
-
model =
|
| 64 |
output = model.infer_protein(sequence, num_loops=3, num_sampling_steps=50)
|
| 65 |
|
| 66 |
print(f"pLDDT mean: {float(output['plddt'].mean()):.3f}, pTM: {float(output['ptm'].mean()):.3f}")
|
|
@@ -72,12 +72,12 @@ You can also fold complex biomolecules — proteins, DNA/RNA (with modified resi
|
|
| 72 |
from esm.models.esmfold2 import (
|
| 73 |
DNAInput,
|
| 74 |
ESMFold2InputBuilder,
|
|
|
|
| 75 |
LigandInput,
|
| 76 |
Modification,
|
| 77 |
ProteinInput,
|
| 78 |
StructurePredictionInput,
|
| 79 |
)
|
| 80 |
-
from transformers.models.esmfold2.modeling_esmfold2 import ESMFold2Model
|
| 81 |
|
| 82 |
HHAI_SEQ = (
|
| 83 |
"MIEIKDKQLTGLRFIDLFAGLGGFRLALESCGAECVYSNEWDKYAQEVYEMNFGEKPEGDITQVNEKTIPDH"
|
|
@@ -87,7 +87,7 @@ HHAI_SEQ = (
|
|
| 87 |
"YKVHPSTSQAYKQFGNSVVINVLQYIAYNIGSSLNFKPY"
|
| 88 |
)
|
| 89 |
|
| 90 |
-
model =
|
| 91 |
|
| 92 |
spi = StructurePredictionInput(
|
| 93 |
sequences=[
|
|
|
|
| 45 |
|
| 46 |
### Usage
|
| 47 |
|
| 48 |
+
Please install `esm` from PyPI:
|
| 49 |
|
| 50 |
```
|
| 51 |
+
pip install esm
|
| 52 |
```
|
| 53 |
|
| 54 |
You can fold your first protein with:
|
| 55 |
|
| 56 |
```py
|
| 57 |
+
from transformers.models.esmfold2.modeling_esmfold2 import EsmFold2Model
|
| 58 |
|
| 59 |
# Ubiquitin (PDB 1UBQ)
|
| 60 |
sequence = "MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG"
|
| 61 |
|
| 62 |
# optionally use "biohub/ESMFold2"
|
| 63 |
+
model = EsmFold2Model.from_pretrained("biohub/ESMFold2-Fast", device_map="auto").eval()
|
| 64 |
output = model.infer_protein(sequence, num_loops=3, num_sampling_steps=50)
|
| 65 |
|
| 66 |
print(f"pLDDT mean: {float(output['plddt'].mean()):.3f}, pTM: {float(output['ptm'].mean()):.3f}")
|
|
|
|
| 72 |
from esm.models.esmfold2 import (
|
| 73 |
DNAInput,
|
| 74 |
ESMFold2InputBuilder,
|
| 75 |
+
EsmFold2Model,
|
| 76 |
LigandInput,
|
| 77 |
Modification,
|
| 78 |
ProteinInput,
|
| 79 |
StructurePredictionInput,
|
| 80 |
)
|
|
|
|
| 81 |
|
| 82 |
HHAI_SEQ = (
|
| 83 |
"MIEIKDKQLTGLRFIDLFAGLGGFRLALESCGAECVYSNEWDKYAQEVYEMNFGEKPEGDITQVNEKTIPDH"
|
|
|
|
| 87 |
"YKVHPSTSQAYKQFGNSVVINVLQYIAYNIGSSLNFKPY"
|
| 88 |
)
|
| 89 |
|
| 90 |
+
model = EsmFold2Model.from_pretrained("biohub/ESMFold2", device="cuda").eval()
|
| 91 |
|
| 92 |
spi = StructurePredictionInput(
|
| 93 |
sequences=[
|