Run this model with HF Jobs
Run GleghornLab/cdsBERT-plus 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/GleghornLab/cdsBERT-plus. 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/GleghornLab/cdsBERT-plus 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 GleghornLab/cdsBERT-plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GleghornLab/cdsBERT-plus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="GleghornLab/cdsBERT-plus")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("GleghornLab/cdsBERT-plus") model = AutoModel.from_pretrained("GleghornLab/cdsBERT-plus", device_map="auto") - Notebooks
- Google Colab
- Kaggle
cdsBERT
Model description
cdsBERT+ is a pLM with a codon vocabulary that was seeded with ProtBERT and trained with a novel vocabulary extension pipeline called MELD. cdsBERT+ offers a highly biologically relevant latent space with excellent EC number prediction surpassing ProtBERT. Specifically, this is the half-precision checkpoint after student-teacher knowledge distillation with Ankh-base.
How to use
# Imports
import re
import torch
import torch.nn.functional as F
from transformers import BertModel, BertTokenizer
model = BertModel.from_pretrained('lhallee/cdsBERT') # load model
tokenizer = BertTokenizer.from_pretrained('lhallee/cdsBERT') # load tokenizer
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') # gather device
model.to(device) # move to device
model.eval() # put in eval mode
sequence = '(ZEVLPYGDEKLSPYGDGGDVGQIFsC#LQDTNNFFGAgQNK%OPKLGQIG%SK%uuieddRidDVLkn(TDK@pp^v]' # CCDS207.1|Hs110|chr1
sequence = ' '.join(list(sequence)) # need spaces in-between codons
example = tokenizer(sequence, return_tensors='pt', padding=False).to(device) # tokenize example
with torch.no_grad():
matrix_embedding = model(**example).last_hidden_state.cpu()
vector_embedding = matrix_embedding.mean(dim=0)
Intended use and limitations
cdsBERT+ serves as a general-purpose protein language model with a codon vocabulary. Fine-tuning with Huggingface transformers models like BertForSequenceClassification enables downstream classification and regression tasks. Currently, the base capability enables feature extraction. The based checkpoint after MLM, cdsBERT, can conduct mask-filling.
Our lab
The Gleghorn lab is an interdisciplinary research group at the University of Delaware that focuses on solving translational problems with our expertise in engineering, biology, and chemistry. We develop inexpensive and reliable tools to study organ development, maternal-fetal health, and drug delivery. Recently we have begun exploration into protein language models and strive to make protein design and annotation accessible.
Please cite
@article {Hallee_cds_2023, author = {Logan Hallee, Nikolaos Rafailidis, and Jason P. Gleghorn}, title = {cdsBERT - Extending Protein Language Models with Codon Awareness}, year = {2023}, doi = {10.1101/2023.09.15.558027}, publisher = {Cold Spring Harbor Laboratory}, journal = {bioRxiv} }
- Downloads last month
- 93