Views
No views yet
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4# Load model (automatically quantizes to 4-bit)
5model = AutoModelForCausalLM.from_pretrained(
6 "dnagpt/OmniGene-4-CPT-v2-4bit",
7 device_map="auto", # Automatically applies quantization_config.json
8)
9tokenizer = AutoTokenizer.from_pretrained("dnagpt/OmniGene-4-CPT-v2-4bit")
10
11# Generate
12prompt = "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQAPILSRVGDGTQDNLSGAEKAVQVKVKALPDAQFEVVHSLAKWKRQTLGQHDFSAGEGLYTHMKALRPDEDRLSPLHSVYVDQWDWERVMGDGERQFSTLKSTVEAIWAGIKATEAAVSEEFGLAPFLPDQIHFVHSQELLSRYPDLDAKGRERAIAKDLGAVFLVGIGGKLSDGHRHDVRAPDYDDWSTPSELGHAGLNGDILVWNPVLEDAFELSSMGIRVDADTLKHQLALTGDEDRLELEWHQALLRGEMPQTIGGGIGQSRLTMLLLQLPHIGQVQAGVWPAAVRESVPSLL"
13
14inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
15outputs = model.generate(**inputs, max_new_tokens=100)
16print(tokenizer.decode(outputs[0], skip_special_tokens=True))quantization_config.json.| Source | Size | Tokens | Proportion |
|---|---|---|---|
| DNA (human genome) | 8.0 GB | 2.1B | 24.6% |
| Protein (UniProt) | 8.0 GB | 2.1B | 24.6% |
| Protein (LucaOne) | 7.5 GB | 2.0B | 23.1% |
| OpenWebText | 8.0 GB | 2.1B | 24.6% |
| Structure (3Di + DSSP) | 0.4 GB | 0.1B | 1.2% |
| Instruction replay | 0.6 GB | 0.4B | 1.9% |
1@article{wang2026omnigene4,
2 title={OmniGene-4: A Unified Bio-Language MoE Model with Router-Level Interpretability},
3 author={Wang, Liang},
4 journal={bioRxiv},
5 year={2026}
6}