Instructions to use Synthyra/ESM2-650M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESM2-650M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Synthyra/ESM2-650M", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Synthyra/ESM2-650M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update FastPLMs files
Browse files- README.md +6 -6
- fastplms/models.toml +8 -8
- fastplms_bundle.py +0 -0
- modeling_fastplms.py +8 -7
README.md
CHANGED
|
@@ -123,11 +123,11 @@ Set `output` and `format="safetensors"` or `"sqlite"` for transactional,
|
|
| 123 |
bounded-memory storage. Resume checks input order, model state, tokenizer
|
| 124 |
policy, backend, dtype, and pooling configuration before it appends data.
|
| 125 |
|
| 126 |
-
## Downstream
|
| 127 |
|
| 128 |
-
|
| 129 |
-
untrained `classifier`. Sequence labels have shape `(b,)`.
|
| 130 |
-
shape `(b, l)` and use `-100` outside biological positions
|
| 131 |
|
| 132 |
```python
|
| 133 |
import torch
|
|
@@ -267,8 +267,8 @@ only when you intend to initialize and train that head.
|
|
| 267 |
## Release record
|
| 268 |
|
| 269 |
- FastPLMs weights: `Synthyra/ESM2-650M`
|
| 270 |
-
- Runtime revision: recorded in the built artifact and published commit
|
| 271 |
-
-
|
| 272 |
- Official checkpoint: `facebook/esm2_t33_650M_UR50D`
|
| 273 |
- Artifact source: `fast`
|
| 274 |
- State transform: `esm2_hf_to_fastplms_v1`
|
|
|
|
| 123 |
bounded-memory storage. Resume checks input order, model state, tokenizer
|
| 124 |
policy, backend, dtype, and pooling configuration before it appends data.
|
| 125 |
|
| 126 |
+
## Downstream prediction
|
| 127 |
|
| 128 |
+
The sequence and token prediction AutoClasses use the checkpoint backbone and
|
| 129 |
+
create a new, untrained `classifier`. Sequence labels have shape `(b,)`.
|
| 130 |
+
Residue labels have shape `(b, l)` and use `-100` outside biological positions.
|
| 131 |
|
| 132 |
```python
|
| 133 |
import torch
|
|
|
|
| 267 |
## Release record
|
| 268 |
|
| 269 |
- FastPLMs weights: `Synthyra/ESM2-650M`
|
| 270 |
+
- Runtime revision: recorded separately in the built artifact and published commit
|
| 271 |
+
- Runtime source identities: recorded in `source-record.json`
|
| 272 |
- Official checkpoint: `facebook/esm2_t33_650M_UR50D`
|
| 273 |
- Artifact source: `fast`
|
| 274 |
- State transform: `esm2_hf_to_fastplms_v1`
|
fastplms/models.toml
CHANGED
|
@@ -199,7 +199,7 @@ representative = "esmc_small"
|
|
| 199 |
documentation = "docs/models.md#esm-and-esmc"
|
| 200 |
test_tiers = ["check", "compliance", "feature", "artifact", "benchmark"]
|
| 201 |
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/esm_plusplus", "models/ttt.py"]
|
| 202 |
-
auto_map = { AutoConfig = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusConfig", AutoModel = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusModel", AutoModelForMaskedLM = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusForMaskedLM" }
|
| 203 |
|
| 204 |
[families.esm3]
|
| 205 |
architecture = "ESM3"
|
|
@@ -223,7 +223,7 @@ representative = "esm3_small"
|
|
| 223 |
documentation = "docs/models.md#esm3"
|
| 224 |
test_tiers = ["check", "compliance", "feature", "artifact", "benchmark"]
|
| 225 |
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/esm3", "models/ttt.py"]
|
| 226 |
-
auto_map = { AutoConfig = "fastplms.models.esm3.modeling_esm3.FastESM3Config", AutoModel = "fastplms.models.esm3.modeling_esm3.FastESM3Model" }
|
| 227 |
|
| 228 |
[families.e1]
|
| 229 |
architecture = "E1"
|
|
@@ -370,8 +370,8 @@ conversion_provenance = "Input: the pinned native Meta ESMFold checkpoint plus i
|
|
| 370 |
representative = "esmfold"
|
| 371 |
documentation = "docs/models.md#esmfold"
|
| 372 |
test_tiers = ["check", "compliance", "structure", "feature", "artifact", "benchmark"]
|
| 373 |
-
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/_esm_rotary.py", "models/esmfold"]
|
| 374 |
-
auto_map = { AutoConfig = "fastplms.models.esmfold.modeling_fast_esmfold.FastEsmFoldConfig", AutoModel = "fastplms.models.esmfold.modeling_fast_esmfold.FastEsmForProteinFolding" }
|
| 375 |
|
| 376 |
[families.esmfold2]
|
| 377 |
architecture = "ESMFold2"
|
|
@@ -396,8 +396,8 @@ conversion_provenance = "Input: each pinned Biohub ESMFold2 checkpoint and its s
|
|
| 396 |
representative = "esmfold2"
|
| 397 |
documentation = "docs/esmfold2.md"
|
| 398 |
test_tiers = ["check", "compliance", "structure", "feature", "artifact", "benchmark"]
|
| 399 |
-
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/esmfold2", "models/esm_plusplus", "models/ttt.py"]
|
| 400 |
-
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2.ESMFold2Model" }
|
| 401 |
|
| 402 |
[[models]]
|
| 403 |
id = "esm2_8m"
|
|
@@ -1215,7 +1215,7 @@ official_files = [
|
|
| 1215 |
"config.json=git-sha1:79ed0dc0f867b8f09bfa004d6f77397c2ab9b38d",
|
| 1216 |
"model.safetensors=sha256:01358c317428d38535e3db513cab177336fc0f7fab0d84002e64b7741d5181b3",
|
| 1217 |
]
|
| 1218 |
-
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel" }
|
| 1219 |
|
| 1220 |
[[models]]
|
| 1221 |
id = "esmfold2_experimental_fast_cutoff2025"
|
|
@@ -1236,4 +1236,4 @@ official_files = [
|
|
| 1236 |
"config.json=git-sha1:0333d68ddb12ed2f066741dcb801142f466c0a2c",
|
| 1237 |
"model.safetensors=sha256:4e903b740ad6ad704ec60881bfd593e0d6c874a630ffa0f0838276e0b665088f",
|
| 1238 |
]
|
| 1239 |
-
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel" }
|
|
|
|
| 199 |
documentation = "docs/models.md#esm-and-esmc"
|
| 200 |
test_tiers = ["check", "compliance", "feature", "artifact", "benchmark"]
|
| 201 |
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/esm_plusplus", "models/ttt.py"]
|
| 202 |
+
auto_map = { AutoConfig = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusConfig", AutoModel = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusModel", AutoModelForMaskedLM = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusForMaskedLM", AutoModelForSequenceClassification = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esm_plusplus.modeling_esm_plusplus.ESMplusplusForTokenClassification" }
|
| 203 |
|
| 204 |
[families.esm3]
|
| 205 |
architecture = "ESM3"
|
|
|
|
| 223 |
documentation = "docs/models.md#esm3"
|
| 224 |
test_tiers = ["check", "compliance", "feature", "artifact", "benchmark"]
|
| 225 |
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/esm3", "models/ttt.py"]
|
| 226 |
+
auto_map = { AutoConfig = "fastplms.models.esm3.modeling_esm3.FastESM3Config", AutoModel = "fastplms.models.esm3.modeling_esm3.FastESM3Model", AutoModelForSequenceClassification = "fastplms.models.esm3.modeling_esm3.FastESM3ForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esm3.modeling_esm3.FastESM3ForTokenClassification" }
|
| 227 |
|
| 228 |
[families.e1]
|
| 229 |
architecture = "E1"
|
|
|
|
| 370 |
representative = "esmfold"
|
| 371 |
documentation = "docs/models.md#esmfold"
|
| 372 |
test_tiers = ["check", "compliance", "structure", "feature", "artifact", "benchmark"]
|
| 373 |
+
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/_esm_rotary.py", "models/classification_probe.py", "models/esmfold"]
|
| 374 |
+
auto_map = { AutoConfig = "fastplms.models.esmfold.modeling_fast_esmfold.FastEsmFoldConfig", AutoModel = "fastplms.models.esmfold.modeling_fast_esmfold.FastEsmForProteinFolding", AutoModelForSequenceClassification = "fastplms.models.esmfold.modeling_fast_esmfold.FastEsmForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold.modeling_fast_esmfold.FastEsmForTokenClassification" }
|
| 375 |
|
| 376 |
[families.esmfold2]
|
| 377 |
architecture = "ESMFold2"
|
|
|
|
| 396 |
representative = "esmfold2"
|
| 397 |
documentation = "docs/esmfold2.md"
|
| 398 |
test_tiers = ["check", "compliance", "structure", "feature", "artifact", "benchmark"]
|
| 399 |
+
runtime_paths = ["__init__.py", "registry.py", "runtime.py", "models.toml", "models/__init__.py", "attention", "embeddings", "models/classification_probe.py", "models/_esm_rotary.py", "models/esmfold2", "models/esm_plusplus", "models/ttt.py"]
|
| 400 |
+
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2.ESMFold2Model", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ForTokenClassification" }
|
| 401 |
|
| 402 |
[[models]]
|
| 403 |
id = "esm2_8m"
|
|
|
|
| 1215 |
"config.json=git-sha1:79ed0dc0f867b8f09bfa004d6f77397c2ab9b38d",
|
| 1216 |
"model.safetensors=sha256:01358c317428d38535e3db513cab177336fc0f7fab0d84002e64b7741d5181b3",
|
| 1217 |
]
|
| 1218 |
+
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForTokenClassification" }
|
| 1219 |
|
| 1220 |
[[models]]
|
| 1221 |
id = "esmfold2_experimental_fast_cutoff2025"
|
|
|
|
| 1236 |
"config.json=git-sha1:0333d68ddb12ed2f066741dcb801142f466c0a2c",
|
| 1237 |
"model.safetensors=sha256:4e903b740ad6ad704ec60881bfd593e0d6c874a630ffa0f0838276e0b665088f",
|
| 1238 |
]
|
| 1239 |
+
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForTokenClassification" }
|
fastplms_bundle.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
modeling_fastplms.py
CHANGED
|
@@ -8,11 +8,12 @@ import sys
|
|
| 8 |
import tempfile
|
| 9 |
from io import BytesIO
|
| 10 |
from pathlib import Path
|
|
|
|
| 11 |
from zipfile import ZIP_DEFLATED, ZipFile
|
| 12 |
|
| 13 |
from .fastplms_bundle import RUNTIME_DATA, RUNTIME_HASH
|
| 14 |
|
| 15 |
-
if RUNTIME_HASH != "
|
| 16 |
raise RuntimeError("FastPLMs runtime identity differs from the bridge.")
|
| 17 |
|
| 18 |
_RUNTIME_TEMPORARIES = []
|
|
@@ -179,14 +180,14 @@ def _install_runtime():
|
|
| 179 |
return package
|
| 180 |
|
| 181 |
_install_runtime()
|
| 182 |
-
|
| 183 |
-
FastEsmConfig =
|
| 184 |
FastEsmConfig.__module__ = __name__
|
| 185 |
-
FastEsmForMaskedLM =
|
| 186 |
FastEsmForMaskedLM.__module__ = __name__
|
| 187 |
-
FastEsmForSequenceClassification =
|
| 188 |
FastEsmForSequenceClassification.__module__ = __name__
|
| 189 |
-
FastEsmForTokenClassification =
|
| 190 |
FastEsmForTokenClassification.__module__ = __name__
|
| 191 |
-
FastEsmModel =
|
| 192 |
FastEsmModel.__module__ = __name__
|
|
|
|
| 8 |
import tempfile
|
| 9 |
from io import BytesIO
|
| 10 |
from pathlib import Path
|
| 11 |
+
from typing import ClassVar
|
| 12 |
from zipfile import ZIP_DEFLATED, ZipFile
|
| 13 |
|
| 14 |
from .fastplms_bundle import RUNTIME_DATA, RUNTIME_HASH
|
| 15 |
|
| 16 |
+
if RUNTIME_HASH != "b9cbb5d056829c624b46d5110969c7a033d1077232c36e33580b023faf4155bf":
|
| 17 |
raise RuntimeError("FastPLMs runtime identity differs from the bridge.")
|
| 18 |
|
| 19 |
_RUNTIME_TEMPORARIES = []
|
|
|
|
| 180 |
return package
|
| 181 |
|
| 182 |
_install_runtime()
|
| 183 |
+
_module_182 = _import_without_bytecode("fastplms.models.esm2.modeling_fastesm")
|
| 184 |
+
FastEsmConfig = _module_182.FastEsmConfig
|
| 185 |
FastEsmConfig.__module__ = __name__
|
| 186 |
+
FastEsmForMaskedLM = _module_182.FastEsmForMaskedLM
|
| 187 |
FastEsmForMaskedLM.__module__ = __name__
|
| 188 |
+
FastEsmForSequenceClassification = _module_182.FastEsmForSequenceClassification
|
| 189 |
FastEsmForSequenceClassification.__module__ = __name__
|
| 190 |
+
FastEsmForTokenClassification = _module_182.FastEsmForTokenClassification
|
| 191 |
FastEsmForTokenClassification.__module__ = __name__
|
| 192 |
+
FastEsmModel = _module_182.FastEsmModel
|
| 193 |
FastEsmModel.__module__ = __name__
|