{"success":true,"data":{"author":"Zhihan Zhou, Han Liu et al. (MAGICS Lab)","bucketAccessType":"public","bucketName":"models/zhihan1996/DNABERT-2-117M","bucketPrefix":"","category":"Genomics & Bioinformatics","cloudProvider":"huggingface","createdAt":"2026-11-16T15:25:49.234Z","description":"Open weights for DNABERT-2, the official 117 million parameter genome foundation model from Zhou et al. (ICLR 2024), trained on genomes from many species. It replaces k-mer tokens with byte pair encoding over DNA and uses ALiBi attention, so it accepts sequences of varying length and produces 768-dimensional embeddings by mean or max pooling over hidden states. The mounted repo holds pytorch_model.bin (468 MB), config.json, the BPE tokenizer and the custom MosaicBERT modelling code, loaded with transformers and trust_remote_code from the mount path. Pair it with the reference genome, 1000 Genomes or HPRC archives to embed sequence next to the data. Apache 2.0.","displayTitle":"DNABERT-2 117M multi-species genome foundation model weights","huggingFaceUrl":"https://huggingface.co/zhihan1996/DNABERT-2-117M","id":"96532320-8a01-5447-8e00-0dc5afcb7640","license":"Apache-2.0","licenseEvidenceUrl":"https://github.com/MAGICS-LAB/DNABERT_2/blob/main/LICENSE","objectCountEstimate":12,"probeStatus":"ok","referenceUrl":"https://arxiv.org/abs/2306.15006","region":"us","schemaCard":{"accessHints":[{"language":"python-hub","snippet":"from huggingface_hub import snapshot_download\nsnapshot_download(repo_id=\"zhihan1996/DNABERT-2-117M\")  # or read /mnt/archive directly"}],"caveats":["HuggingFace metadata: author=zhihan1996, library=transformers, downloads=139651","Weights are read lazily from the mount. Copying them to local disk first is faster when a model is loaded many times."],"format":"binary","generatedAt":"2026-11-17T19:17:25.705Z","layout":{"example":"pytorch_model.bin","pattern":"{repoId}/{filename}"},"mountPath":"/mnt/archive","sampleObjects":["config.json","pytorch_model.bin"],"sidecars":[{"bytes":"                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-c","encoding":"utf8","key":"LICENSE","name":"LICENSE","size":11357,"truncated":true},{"bytes":"---\nmetrics:\n- matthews_correlation\n- f1\ntags:\n- biology\n- medical\n- genomics\n---\nThis is the official pre-trained model introduced in [DNABERT-2: Efficient Foundation Model and Benchmark For Multi-Species Genome\n](https://arxiv.org/pdf/2306.15006.pdf).\n\nWe sincerely appreciate the MosaicML team for the [MosaicBERT](https://openreview.net/forum?id=5zipcfLC2Z) implementation, which serves as the base of DNABERT-2 development. \n\nDNABERT-2 is a transformer-based genome foundation model trained on multi-species genome. \n\nTo load the model from huggingface:\n```\nimport torch\nfrom transformers import AutoTokenizer, AutoModel\n\ntokenizer = AutoTokenizer.from_pretrained(\"zhihan1996/DNABERT-2-117M\", trust_remote_code=True)\nmodel = AutoModel.from_pretrained(\"zhihan1996/DNABERT-2-117M\", trust_remote_code=True)\n```\n\nTo calculate the embedding of a dna sequence\n```\ndna = \"ACGTAGCATCGGATCTATCTATCGACACTTGGTTATCGATCTACGAGCATCTCGTTAGC\"\ninputs = tokenizer(dna, return_tensors = 'pt')[\"input_ids\"]\nhidden_states = model(inputs)[0] # [1, sequence_length, 768]\n\n# embedding with mean pooling\nembedding_mean = torch.mean(hidden_states[0], dim=0)\nprint(embedding_mean.shape) # expect to be 768\n\n# embedding with max pooling\nembedding_max = torch.max(hidden_states[0], dim=0)[0]\nprint(embedding_max.shape) # expect to be 768\n```","encoding":"utf8","key":"README.md","name":"README.md","size":1316,"truncated":false}],"sourceObjectKey":"pytorch_model.bin","starterCell":"import os, json\nbase = \"/mnt/archive\"   # this model repo, mounted read-only\nfiles = sorted(os.listdir(base)); print(files)\nprint(json.dumps(json.load(open(os.path.join(base, \"config.json\"))), indent=1)[:800])\nprint(\"pytorch_model.bin\", os.path.getsize(os.path.join(base, \"pytorch_model.bin\")) // 2**20, \"MB\")","totalObjects":12},"summary":"Open weights for DNABERT-2, the official 117 million parameter genome foundation model from Zhou et al. (ICLR 2024), trained on genomes from many species.","title":"DNABERT-2 117M multi-species genome foundation model weights","updatedAt":"2026-11-17T19:17:25.956Z","visibility":"public","websiteUrl":"https://huggingface.co/zhihan1996/DNABERT-2-117M"}}