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-150M on huggingface.co
275
Total runs
1
24-hour runs
-356
3-day runs
-325
7-day runs
-454
30-day runs
More Information About DPLM-150M huggingface.co Model
DPLM-150M huggingface.co
DPLM-150M huggingface.co is an AI model on huggingface.co that provides DPLM-150M's model effect (), which can be used instantly with this Synthyra DPLM-150M model. huggingface.co supports a free trial of the DPLM-150M model, and also provides paid use of the DPLM-150M. Support call DPLM-150M model through api, including Node.js, Python, http.
DPLM-150M huggingface.co is an online trial and call api platform, which integrates DPLM-150M's modeling effects, including api services, and provides a free online trial of DPLM-150M, you can try DPLM-150M online for free by clicking the link below.
Synthyra DPLM-150M online free url in huggingface.co:
DPLM-150M is an open source model from GitHub that offers a free installation service, and any user can find DPLM-150M on GitHub to install. At the same time, huggingface.co provides the effect of DPLM-150M install, users can directly use DPLM-150M installed effect in huggingface.co for debugging and trial. It also supports api for free installation.