Instructions to use Synthyra/DPLM2-650M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/DPLM2-650M with Transformers:
# Load model directly from transformers import AutoTokenizer, EsmForDPLM2 tokenizer = AutoTokenizer.from_pretrained("Synthyra/DPLM2-650M", trust_remote_code=True) model = EsmForDPLM2.from_pretrained("Synthyra/DPLM2-650M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update FastPLMs files
Browse files- README.md +8 -8
- fastplms/models.toml +8 -8
- fastplms_bundle.py +0 -0
- modeling_fastplms.py +10 -9
README.md
CHANGED
|
@@ -97,11 +97,11 @@ Set `output` and `format="safetensors"` or `"sqlite"` for transactional,
|
|
| 97 |
bounded-memory storage. Resume checks input order, model state, tokenizer
|
| 98 |
policy, backend, dtype, and pooling configuration before it appends data.
|
| 99 |
|
| 100 |
-
## Downstream
|
| 101 |
|
| 102 |
-
|
| 103 |
-
untrained `classifier`. Sequence labels have shape `(b,)`.
|
| 104 |
-
shape `(b, l)` and use `-100` outside biological positions
|
| 105 |
|
| 106 |
```python
|
| 107 |
import torch
|
|
@@ -256,10 +256,10 @@ atomic-publication checks.
|
|
| 256 |
## Release record
|
| 257 |
|
| 258 |
- FastPLMs weights: `Synthyra/DPLM2-650M`
|
| 259 |
-
- Runtime revision: recorded in the built artifact and published commit
|
| 260 |
-
-
|
| 261 |
-
- Canonical transformed state
|
| 262 |
-
- Conversion equality attestation: recorded in
|
| 263 |
- Official checkpoint: `airkingbd/dplm2_650m`
|
| 264 |
- Artifact source: `official`
|
| 265 |
- State transform: `dplm2_to_fastplms_v1`
|
|
|
|
| 97 |
bounded-memory storage. Resume checks input order, model state, tokenizer
|
| 98 |
policy, backend, dtype, and pooling configuration before it appends data.
|
| 99 |
|
| 100 |
+
## Downstream prediction
|
| 101 |
|
| 102 |
+
The sequence and token prediction AutoClasses use the checkpoint backbone and
|
| 103 |
+
create a new, untrained `classifier`. Sequence labels have shape `(b,)`.
|
| 104 |
+
Residue labels have shape `(b, l)` and use `-100` outside biological positions.
|
| 105 |
|
| 106 |
```python
|
| 107 |
import torch
|
|
|
|
| 256 |
## Release record
|
| 257 |
|
| 258 |
- FastPLMs weights: `Synthyra/DPLM2-650M`
|
| 259 |
+
- Runtime revision: recorded separately in the built artifact and published commit
|
| 260 |
+
- Runtime source identities: recorded in `source-record.json`
|
| 261 |
+
- Canonical transformed state identity: recorded in `source-record.json`
|
| 262 |
+
- Conversion equality attestation: recorded in `source-record.json`
|
| 263 |
- Official checkpoint: `airkingbd/dplm2_650m`
|
| 264 |
- Artifact source: `official`
|
| 265 |
- State transform: `dplm2_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,17 +180,17 @@ def _install_runtime():
|
|
| 179 |
return package
|
| 180 |
|
| 181 |
_install_runtime()
|
| 182 |
-
|
| 183 |
-
DPLM2Config =
|
| 184 |
DPLM2Config.__module__ = __name__
|
| 185 |
-
DPLM2ForMaskedLM =
|
| 186 |
DPLM2ForMaskedLM.__module__ = __name__
|
| 187 |
-
DPLM2ForSequenceClassification =
|
| 188 |
DPLM2ForSequenceClassification.__module__ = __name__
|
| 189 |
-
DPLM2ForTokenClassification =
|
| 190 |
DPLM2ForTokenClassification.__module__ = __name__
|
| 191 |
-
DPLM2Model =
|
| 192 |
DPLM2Model.__module__ = __name__
|
| 193 |
-
|
| 194 |
-
DPLM2Tokenizer =
|
| 195 |
DPLM2Tokenizer.__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 != "fbd2bd155dd56f7aec6b9a945997b33560902cd7ab7713458c81360ff3209cc4":
|
| 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.dplm2.modeling_dplm2")
|
| 184 |
+
DPLM2Config = _module_182.DPLM2Config
|
| 185 |
DPLM2Config.__module__ = __name__
|
| 186 |
+
DPLM2ForMaskedLM = _module_182.DPLM2ForMaskedLM
|
| 187 |
DPLM2ForMaskedLM.__module__ = __name__
|
| 188 |
+
DPLM2ForSequenceClassification = _module_182.DPLM2ForSequenceClassification
|
| 189 |
DPLM2ForSequenceClassification.__module__ = __name__
|
| 190 |
+
DPLM2ForTokenClassification = _module_182.DPLM2ForTokenClassification
|
| 191 |
DPLM2ForTokenClassification.__module__ = __name__
|
| 192 |
+
DPLM2Model = _module_182.DPLM2Model
|
| 193 |
DPLM2Model.__module__ = __name__
|
| 194 |
+
_module_193 = _import_without_bytecode("fastplms.models.dplm2.tokenization_dplm2")
|
| 195 |
+
DPLM2Tokenizer = _module_193.DPLM2Tokenizer
|
| 196 |
DPLM2Tokenizer.__module__ = __name__
|