Instructions to use Synthyra/DPLM-650M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/DPLM-650M with Transformers:
# Load model directly from transformers import EsmForDPLM model = EsmForDPLM.from_pretrained("Synthyra/DPLM-650M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Synthyra/DPLM-650M
This checkpoint packages the FastPLMs DPLM implementation.
Accepted inputs are amino-acid sequences tokenized to masked or partially
masked residue IDs.
Supported Transformers entry points are AutoConfig, AutoModel,
AutoModelForMaskedLM, AutoModelForSequenceClassification,
AutoModelForTokenClassification.
Install and platform requirements
Install the current FastPLMs package:
python -m pip install \
"fastplms @ git+https://github.com/Synthyra/FastPLMs.git"
Python 3.11-3.14, PyTorch 2.13, and Transformers 5.13 are required. Eager, SDPA, and Flex use the core install. FlashAttention requires the flash extra, compatible CUDA hardware, and BF16 execution. The Hub quick start below requires network
access on first download. For an air-gapped run, first build the manifest-pinned
local artifact and use the offline form shown in the example.
Quick start
from transformers import AutoModel
model_id = "Synthyra/DPLM-650M"
model = AutoModel.from_pretrained(
model_id,
trust_remote_code=True,
).eval()
This example uses the published Hub repository. For offline validation, build
the manifest-pinned artifact and replace model_id with its local
dist/hub/DPLM-650M path, then pass local_files_only=True.
Leave attention unspecified for the Transformers default. Supported explicit
choices are eager, sdpa, flex_attention, flash_attention_3.
Pass the selected name through attn_implementation.
When an optimized backend cannot return full attention tensors,
output_attentions=True emits one explicit runtime warning and uses a correctly
masked eager implementation for that call only. The warning identifies the
configured backend, effective backend, and reason. Configuration and later
calls are unchanged.
For BF16 execution, this family uses FP32 parameters with CUDA BF16 autocast.
Tokenization and forward inference
Load the tokenizer from the same artifact as the model. Padding is represented explicitly by the attention mask:
import torch
from transformers import AutoTokenizer
model_id = "Synthyra/DPLM-650M"
tokenizer = AutoTokenizer.from_pretrained(
model_id,
trust_remote_code=True,
)
batch = tokenizer(
["MSTNPKPQRKTKRNT", "MKTIIALSYIFCLVFA"],
padding=True,
return_tensors="pt",
)
with torch.inference_mode():
output = model(**batch)
print(output.last_hidden_state.shape)
Dataset embeddings
The shared embedding API accepts sequences, (id, sequence) pairs,
EmbeddingInput records, insertion-ordered {id: sequence} mappings, or a
FASTA path. Results preserve order and duplicate identifiers:
result = model.embed_dataset(
["MSTNPKPQRKTKRNT", "MKTIIALSYIFCLVFA"],
batch_size=2,
pooling=("mean", "std"),
)
for record in result:
print(record.id, record.sequence, record.tensor.shape)
Set full_embeddings=True for one residue tensor with shape (l, d) per
sequence. Set output to a directory for bounded-memory, transactional
safetensors with ordered-prefix resume, or choose format="sqlite" for
batch-level database commits and exact resume. Pooling excludes boundary,
padding, and other non-biological positions.
For a long FASTA run, stream completed batches into SQLite:
persisted = model.embed_dataset(
"proteins.fasta",
batch_size=64,
pooling=("mean",),
output="protein-embeddings.sqlite",
format="sqlite",
resume=True,
)
Resume verifies the input order, model state, tokenizer policy, backend, dtype, and pooling configuration. It never appends incompatible records to an existing run.
Diffusion sequence generation
DPLM defines the requested length from biological positions in a tokenized input, masks those positions, and iteratively retains confident predictions:
import torch
from transformers import AutoModelForMaskedLM, AutoTokenizer
model_id = "Synthyra/DPLM-650M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
generator = AutoModelForMaskedLM.from_pretrained(
model_id,
trust_remote_code=True,
).cuda().eval()
input_ids = tokenizer("A" * 64, return_tensors="pt")["input_ids"].cuda()
with torch.inference_mode():
generated_ids = generator.generate(input_ids, max_iter=100)
sequence = tokenizer.decode(
generated_ids[0],
skip_special_tokens=True,
).replace(" ", "")
print(sequence)
Omitting max_iter uses the official 500-step schedule. A shorter schedule
changes the sampling process rather than providing an equivalent faster mode.
Plain AutoModel omits the optional ESM pooler because this diffusion
checkpoint contains no trained pooler weights. Pass add_pooling_layer=True
only when intentionally initializing and training that head.
DPLM1 and DPLM2 checkpoint weights are Apache-2.0. The maintained ByteDance
LICENSE is Apache-2.0 and the
README
explicitly scopes the repository release to the pretrained DPLM1 and DPLM2
weights. FastPLMs artifacts record weights_license_status="resolved" and
redistributable=true; complete publication is permitted only after all
artifact, legal, parity, and atomic-publication preflights pass.
Runtime contract
- Public input: Amino-acid sequences tokenized to masked or partially masked residue IDs
- Advertised AutoClasses:
AutoConfig,AutoModel,AutoModelForMaskedLM,AutoModelForSequenceClassification,AutoModelForTokenClassification - AutoClass weight status:
AutoConfig=FastPLMs extension,AutoModel=pretrained,AutoModelForMaskedLM=pretrained,AutoModelForSequenceClassification=base weights + untrained task head,AutoModelForTokenClassification=base weights + untrained task head - Attention implementations:
eager,sdpa,flex_attention,flash_attention_3 - Precision policies:
default - BF16 execution:
fp32_parameters_autocast - Generation contract:
required - Optional dependency group:
core - Weight publication allowed:
true - Weight license status:
resolved - Redistributable:
true - Complete weight publication required:
false
Release record
- FastPLMs weights:
Synthyra/DPLM-650M - Runtime revision: recorded separately in the built artifact and published commit
- Source-tree and runtime-bundle SHA-256: recorded in
provenance.json - Generator/schema version and complete/runtime-only attestations: recorded in
provenance.json - Official checkpoint:
airkingbd/dplm_650m - Artifact source:
fast - State transform:
dplm_to_fastplms_v1 - BF16 execution:
fp32_parameters_autocast - Pinned upstreams:
dplm - Reference container:
reference-dplm - Release tiers:
check,compliance,feature,artifact,benchmark - Unresolved required file identities:
0
The local artifact records exact file identities, conversion details, source
revisions, and legal texts in provenance.json. A nonzero unresolved count is a
release blocker.
Validation boundary
For tiers declared by the manifest, the release contract compares applicable semantic configuration, tokenizer behavior, state keys, shapes, dtypes, values, aliases, and representative inference with the pinned official implementation. This metadata does not by itself claim that a particular build passed, that one backend is faster, or that an output has biological or therapeutic validity.
License
Checkpoint terms: Apache-2.0. The Hub model-card identifier is
apache-2.0. Applicable source licenses, notices, attribution,
and conversion records are distributed with the local artifact. Review them
before use.
- Downloads last month
- 113