Downloads ยท 30 days
25
2% of all-time downloads
goodarzilab/decodon-200M-euk
decodon-200M-euk is a text generation model from goodarzilab. Use it when you need the model to write or continue text. It is set up for transformers.
Currently, this is the only way to install the package but will push a pip installable version soon. To install the package from source, run the following command:
Downloads ยท 30 days
25
2% of all-time downloads
All-time downloads
1.6K
Public
Parameters
158M
632 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors632 MB ยท 100%
From the Hugging Face model README
Currently, this is the only way to install the package but will push a pip installable version soon. To install the package from source, run the following command:
pip install git+https://github.com/goodarzilab/cdsFM.git
<!-- #### From pip
```bash
pip install cdsFM
``` -->
Now that you have cdsFM installed, you can use AutoEnCodon and AutoDeCodon classes which serve as wrappers around the pre-trained models. Here are some examples on how to use them:
Following is an example of how to use the EnCodon model to extract sequence embeddings:
from cdsFM import AutoEnCodon
# Load your dataframe containing sequences
seqs = ...
# Load a pre-trained EnCodon model
model = AutoEnCodon.from_pretrained("goodarzilab/encodon-620M")
# Extract embeddings
embeddings = model.get_embeddings(seqs, batch_size=32)
You can generate organism-specific coding sequences with DeCodon simply by:
from cdsFM import AutoDeCodon
# Load a pre-trained DeCodon model
model = AutoDeCodon.from_pretrained("goodarzilab/DeCodon-200M")
# Generate!
gen_seqs = model.generate(
taxid=9606, # NCBI Taxonomy ID for Homo sapiens
num_return_sequences=32, # Number of sequences to return
max_length=1024, # Maximum length of the generated sequence
batch_size=8, # Batch size for generation
)
EnCodon and DeCodon are pre-trained on coding sequences of length up to 2048 codons (i.e. 6144 nucleotides), including the <CLS> token prepended automatically to the beginning of the sequence and the <SEP> token appended at the end. The tokenizer's vocabulary consists of 64 codons and 5 special tokens namely <CLS>, <SEP>, <PAD>, <MASK> and <UNK>.
A collection of pre-trained checkpoints of EnCodon & DeCodon models are available on HuggingFace ๐ค. Following table contains the list of available models:
| Model | name | num. params | description | weights |
|---|---|---|---|---|
| EnCodon | encodon-80M | 80M | Pre-trained checkpoint | ๐ค |
| EnCodon | encodon-80M-euk | 80M | Eukaryotic-expert | ๐ค |
| EnCodon | encodon-620M | 620M | Pre-trained checkpoint | ๐ค |
| EnCodon | encodon-620M-euk | 620M | Eukaryotic-expert | ๐ค |
| DeCodon | decodon-200M | 200M | Pre-trained checkpoint | ๐ค |
| DeCodon | decodon-200M-euk | 200M | Eukaryotic-expert | ๐ค |
@article{Naghipourfar2024,
title = {A Suite of Foundation Models Captures the Contextual Interplay Between Codons},
url = {http://dx.doi.org/10.1101/2024.10.10.617568},
DOI = {10.1101/2024.10.10.617568},
publisher = {Cold Spring Harbor Laboratory},
author = {Naghipourfar, Mohsen and Chen, Siyu and Howard, Mathew and Macdonald, Christian and Saberi, Ali and Hagen, Timo and Mofrad, Mohammad and Coyote-Maestas, Willow and Goodarzi, Hani},
year = {2024},
month = oct
}