Downloads · 30 days
0
dufaultc/contrastive-promoter-protein-pretraining
contrastive-promoter-protein-pretraining is a machine learning model from dufaultc. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
For running models or training new model, see instructions at https://github.com/dufaultc/contrastive-promoter-protein-pretraining
Downloads · 30 days
0
Access
Public
Updated Oct 27, 2026
Repo size
10 GB
Likes
0
Public
Click a slice to open those files.
.pth7.9 GB · 79%
From the Hugging Face model README
For running models or training new model, see instructions at https://github.com/dufaultc/contrastive-promoter-protein-pretraining
| Model File | Trainable parameters | Heads | Layers | d_promoter | Train time | GPU | Training FLOPS |
|---|---|---|---|---|---|---|---|
| C3P_1M.pth | 1M | 4 | 4 | 128 | 1 day | L40s | 9.57 x 10^18 |
| C3P_5M.pth | 5M | 8 | 6 | 256 | 3 days | L40s | 1.59 x 10^19 |
| C3P_25M.pth | 25M | 8 | 8 | 512 | 2.5 days | H100 | 4.76 x 10^19 |
| C3P_100M.pth | 100M | 8 | 8 | 1,024 | 4.5 days | H100 | 1.66 x 10^20 |
Example:
from promoter_protein_clip.model_transformer import SequenceCLIPTransformer
import torch
from huggingface_hub import hf_hub_download
repo_id = "dufaultc/contrastive-promoter-protein-pretraining"
filename = "C3P_100M.pth"
promoter = "ACTCGCTATGCGCTATATCTCTATACGGTTGCCGCGCGGTGTCCCCCGGTAAACTCGCTATGCGCTATATCTCTATACGGTTGCCGCGCGGTGTCCCCCGGTAAACTCGCTATGCGCTATATCTCTATACGGTTGCCGCGCGGTGTCCCCCGGTAA"
checkpoint_path = hf_hub_download(repo_id=repo_id, filename=filename )
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
checkpoint= torch.load(checkpoint_path, map_location=device, weights_only=False)
model = SequenceCLIPTransformer(
protein_model_name=checkpoint['args'].protein_model,
promoter_embedding_dim=checkpoint['args'].promoter_embedding_dim,
depth=checkpoint['args'].transformer_depth,
num_heads=checkpoint['args'].transformer_num_heads,
max_promoter_length=checkpoint['args'].max_promoter_length,
projection_dim=checkpoint['args'].projection_dim,
).to(device)
model = torch.compile(model)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
batch_inputs = model.promoter_tokenizer(
[promoter],
padding=True,
truncation=True,
return_tensors="pt",
)
with torch.no_grad():
embeddings = (
model.promoter_encoder(batch_inputs.to(device)).cpu().numpy()
)