import torch
from transformers import AutoModel, AutoModelForMaskedLM
model_path = "Synthyra/DPLM-150M"
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).eval()
tokenizer = model.tokenizer
batch = tokenizer(["MPRTEIN", "MSEQWENCE"], padding=True, return_tensors="pt")
with torch.no_grad():
hidden = model(**batch).last_hidden_state
mlm = AutoModelForMaskedLM.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).eval()
with torch.no_grad():
logits = mlm(**batch).logits
Attention backend
sdpa
is the default backend. Flex Attention is available by setting
config.attn_backend = "flex"
before loading.
Embed datasets
All DPLM models inherit
EmbeddingMixin
, so you can call
model.embed_dataset(...)
directly.
Runs of Synthyra DPLM-3B on huggingface.co
60
Total runs
0
24-hour runs
-12
3-day runs
-66
7-day runs
-132
30-day runs
More Information About DPLM-3B huggingface.co Model
DPLM-3B huggingface.co
DPLM-3B huggingface.co is an AI model on huggingface.co that provides DPLM-3B's model effect (), which can be used instantly with this Synthyra DPLM-3B model. huggingface.co supports a free trial of the DPLM-3B model, and also provides paid use of the DPLM-3B. Support call DPLM-3B model through api, including Node.js, Python, http.
DPLM-3B huggingface.co is an online trial and call api platform, which integrates DPLM-3B's modeling effects, including api services, and provides a free online trial of DPLM-3B, you can try DPLM-3B online for free by clicking the link below.
Synthyra DPLM-3B online free url in huggingface.co:
DPLM-3B is an open source model from GitHub that offers a free installation service, and any user can find DPLM-3B on GitHub to install. At the same time, huggingface.co provides the effect of DPLM-3B install, users can directly use DPLM-3B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.