OpticalDNA-Rice-2048

ICML 2026 OpticalDNA checkpoint pretrained on rice NIP-T2T (w2048, o1920, uppercase sequences). Released checkpoint: step 150,000.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "hxxiang/opticaldna-rice-2048"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    trust_remote_code=True,
    torch_dtype="auto",
).cuda().eval()

# Visual features only: the language Decoder is not executed.
features = model.extract_features("page.png", pooling="mean", to_cpu=True)

# Decoder inference: short T1 / Free OCR.
prompt = model.build_prompt("t1_full_ocr", length="short")
text = model.generate_document(
    tokenizer,
    "page.png",
    prompt=prompt,
    max_new_tokens=256,
)

# Prompt-conditioned Decoder hidden states.
decoder_features = model.extract_decoder_features(
    tokenizer,
    "page.png",
    prompt=prompt,
    pooling="mean",
    to_cpu=True,
)

For multi-page input, pass pages in reading order, e.g. ["page1.png", "page2.png"].

Code and environment: OpticalDNA GitHub. Paper: Rethinking Genomic Modeling Through Optical Character Recognition, ICML 2026.

Downloads last month
14
Safetensors
Model size
3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train hxxiang/opticaldna-rice-2048