Instructions to use ZhweCheng/cUTRGen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZhweCheng/cUTRGen with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ZhweCheng/cUTRGen", device_map="auto") - Notebooks
- Google Colab
- Kaggle
cUTRGen
cUTRGen is a CDS-conditioned encoder–decoder model for UTR sequence generation, functional prediction and design. This repository provides pretrained and reinforcement-learning-optimized generators for 5′ and 3′ UTRs, together with the paired policies for full-length mRNA design with a fixed CDS.
Code and usage examples: HIM-AIM/cUTRGen.
Checkpoints
| Directory | Model |
|---|---|
c5UTRGen-pretrained/ |
Pretrained 5′ UTR generator |
c5UTRGen-RL/ |
RL-optimized 5′ UTR generator |
c3UTRGen-pretrained/ |
Pretrained 3′ UTR generator |
c3UTRGen-RL/ |
RL-optimized 3′ UTR generator |
full-length-RL/policy_5utr/ |
5′ UTR policy from joint optimization |
full-length-RL/policy_3utr/ |
3′ UTR policy from joint optimization |
Each checkpoint includes config.json and model.safetensors. Keep generation_config.json with its checkpoint when supplied. Use the custom tokenization and generation code in the corresponding code module.
Download
From the cloned code repository, download the weights into the adjacent weights directory:
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="ZhweCheng/cUTRGen",
local_dir="../cUTRGen_weights",
)
To download one model only, add allow_patterns=["c5UTRGen-pretrained/*"], replacing the directory name as needed. For joint generation, download both full-length-RL/policy_5utr/* and full-length-RL/policy_3utr/*.
Generate UTRs
Install the dependencies specified by the relevant module. From the code repository root:
python c5UTRGen/generate.py --model ../cUTRGen_weights/c5UTRGen-pretrained --cds ATGGCTGAAGGTTTCAAACCGGACTAA --count 3
python c3UTRGen/generate.py --model ../cUTRGen_weights/c3UTRGen-pretrained --cds ATGGCTGAAGGTTTCAAACCGGACTAA --count 3
python full-length/generate.py --model ../cUTRGen_weights/full-length-RL --cds ATGGCTGAAGGTTTCAAACCGGACTAA --count 4
Use the corresponding c5UTRGen-RL or c3UTRGen-RL directory for single-end RL-generated UTRs. Full-length generation requires both jointly optimized policies; --count 4 samples four candidates per end and returns sixteen combinations.