--- library_name: transformers license: mit tags: - genomics - dna - opticaldna - vision-language - custom-code datasets: - hxxiang/dna_benchmarks --- # OpticalDNA-HG38-2048 ICML 2026 OpticalDNA checkpoint pretrained on HG38 with 2048-base rendered DNA documents. Released checkpoint: **step 190,000**. ## Usage ```python from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "hxxiang/opticaldna-hg38-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](https://github.com/HongxinXiang/OpticalDNA). Paper: *Rethinking Genomic Modeling Through Optical Character Recognition*, ICML 2026.