Run this model with HF Jobs
Run Synthyra/DPLM2-3B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Synthyra/DPLM2-3B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Synthyra/DPLM2-3B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Synthyra/DPLM2-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/DPLM2-3B with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, EsmForDPLM2 tokenizer = AutoTokenizer.from_pretrained("Synthyra/DPLM2-3B", trust_remote_code=True) model = EsmForDPLM2.from_pretrained("Synthyra/DPLM2-3B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546---library_name: transformerstags: []---# NOTEThe GitHub with the implementation and requirements can be found [here](https://github.com/Synthyra/FastPLMs.git).# DPLM2Synthyra DPLM2 checkpoints are HuggingFace AutoModel compatible and include FastPLMs embedding helpers.## Supported models```pythonmodel_dict = {"Synthyra/DPLM2-150M": "airkingbd/dplm2_150m","Synthyra/DPLM2-650M": "airkingbd/dplm2_650m","Synthyra/DPLM2-3B": "airkingbd/dplm2_3b",}```## Use with transformers```pythonimport torchfrom transformers import AutoModel, AutoModelForMaskedLMmodel_path = "Synthyra/DPLM2-150M"model = AutoModel.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).eval()tokenizer = model.tokenizerbatch = tokenizer(["MPRTEIN", "MSEQWENCE"], padding=True, return_tensors="pt")with torch.no_grad():hidden = model(**batch).last_hidden_statemlm = AutoModelForMaskedLM.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).eval()with torch.no_grad():logits = mlm(**batch).logits```## DPLM2 modality typesDPLM2 infers `type_ids` automatically from `input_ids` and `attention_mask` when they are not provided.## Attention backend`sdpa` is the default backend. Flex Attention is available by setting `config.attn_backend = "flex"` before loading.## Embed datasetsAll DPLM2 models inherit `EmbeddingMixin`, so you can call `model.embed_dataset(...)` directly.12345678910111213141516171819202122232425262728293031323334353637383940414243444546---library_name: transformerstags: []---# NOTEThe GitHub with the implementation and requirements can be found [here](https://github.com/Synthyra/FastPLMs.git).# DPLM2Synthyra DPLM2 checkpoints are HuggingFace AutoModel compatible and include FastPLMs embedding helpers.## Supported models```pythonmodel_dict = {"Synthyra/DPLM2-150M": "airkingbd/dplm2_150m","Synthyra/DPLM2-650M": "airkingbd/dplm2_650m","Synthyra/DPLM2-3B": "airkingbd/dplm2_3b",}```## Use with transformers```pythonimport torchfrom transformers import AutoModel, AutoModelForMaskedLMmodel_path = "Synthyra/DPLM2-150M"model = AutoModel.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).eval()tokenizer = model.tokenizerbatch = tokenizer(["MPRTEIN", "MSEQWENCE"], padding=True, return_tensors="pt")with torch.no_grad():hidden = model(**batch).last_hidden_statemlm = AutoModelForMaskedLM.from_pretrained(model_path, trust_remote_code=True, dtype=torch.float16).eval()with torch.no_grad():logits = mlm(**batch).logits```## DPLM2 modality typesDPLM2 infers `type_ids` automatically from `input_ids` and `attention_mask` when they are not provided.## Attention backend`sdpa` is the default backend. Flex Attention is available by setting `config.attn_backend = "flex"` before loading.## Embed datasetsAll DPLM2 models inherit `EmbeddingMixin`, so you can call `model.embed_dataset(...)` directly.
README.md+46-46