Instructions to use rubenich/genetic-dna-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rubenich/genetic-dna-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rubenich/genetic-dna-tiny")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rubenich/genetic-dna-tiny") model = AutoModelForCausalLM.from_pretrained("rubenich/genetic-dna-tiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rubenich/genetic-dna-tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rubenich/genetic-dna-tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rubenich/genetic-dna-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rubenich/genetic-dna-tiny
- SGLang
How to use rubenich/genetic-dna-tiny with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "rubenich/genetic-dna-tiny" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rubenich/genetic-dna-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "rubenich/genetic-dna-tiny" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rubenich/genetic-dna-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rubenich/genetic-dna-tiny with Docker Model Runner:
docker model run hf.co/rubenich/genetic-dna-tiny
genetic-dna-tiny
A small DNA language model (6.3M parameters) trained from scratch on the human reference genome GRCh37/hg19, built to learn how genomic language models work.
Not for clinical use. Scores from this model are not medical advice or a diagnosis.
Model
- Llama-style decoder (
LlamaForCausalLM): hidden 256, 6 layers, 8 heads, intermediate 1024 - Context: 1024 bases (+
[BOS]/[EOS]) - Objective: next-base prediction (causal language modeling)
- Tokenizer: character level,
[PAD] [UNK] [BOS] [EOS] A C G T N. One base = one token, so a single-base change alters exactly one token. Lowercase (soft-masked) input is uppercased and any other letter becomesN.
Training data
- UCSC hg19 chromosomes from
hgdownload.soe.ucsc.edu - Train: chr22 (both strands), validation: chr21 (+ strand)
- Non-overlapping 1024 bp windows, dropping windows with more than
1% unknown bases (
N) - 4000 steps, batch size 16, learning rate 0.001 (cosine)
Evaluation
Bits per base on chr21 (35,087,360 bases in windows without N),
each base predicted from the bases before it in its window. Uniform guessing = 2.0;
lower is better.
| Method | Bits per base |
|---|---|
| This model | 1.7439 |
| Markov order 0 | 1.9905 |
| Markov order 1 | 1.9522 |
| Markov order 2 | 1.9383 |
| Markov order 3 | 1.9326 |
| Markov order 4 | 1.9258 |
| Markov order 5 | 1.9178 |
| Markov order 6 | 1.9014 |
| Markov order 8 | 1.8574 |
| Markov order 10 | 1.8308 |
| Uniform | 2.0000 |
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("rubenich/genetic-dna-tiny")
model = AutoModelForCausalLM.from_pretrained("rubenich/genetic-dna-tiny")
ids = tok("ACGTTGCA", return_tensors="pt")["input_ids"]
with torch.no_grad():
logits = model(input_ids=ids).logits
Zero-shot variant scoring compares log P(alt window) - log P(ref window) on an hg19
window around a single-base change; see genetic_model.score_variant in the source repo.
Limitations
- Trained on 1 chromosome(s) of one reference genome: it has not seen human variation, other chromosomes, or other species.
- Tiny model and short context: it captures local sequence statistics, not long-range regulatory structure.
- Coordinates and alleles must be GRCh37/hg19, + strand.
- Downloads last month
- 33