跳到正文
Skillpedia
机器学习5.4k · #14859

evo2

它能做什么

这项技能教智能体如何使用 Evo 2,这是一个在 DNA 上训练的大型模型。它可以估算一段序列的可能性,把 DNA 转换为数值供其他工具使用,或在给定前缀后生成新的 DNA。

适用场景

  • ✓当研究人员想评估 DNA 变异如何改变序列的可能性时。
  • ✓当研究人员需要 DNA 窗口的嵌入,用于分类器时。
  • ✓当科学家想从一段起始序列生成新的 DNA 时。

技能链接

https://github.com/aipoch/open-science/blob/main/resources/skills/evo2/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/aipoch/open-science/blob/main/resources/skills/evo2/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我用 Evo 2 为这些 DNA 变异评分,并告诉我哪些变异最明显地降低了可能性。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会加载适合 GPU 的 Evo 2 模型规格,然后用平均对数似然为每条序列评分。它也可以对窗口进行嵌入,或生成接续提示的 DNA。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Evo 2 — DNA Language Model

Prerequisites

Requirement Minimum Recommended
Python 3.11 3.12 (<3.13)
CUDA 12.1+ 12.4+
GPU VRAM 24 GB (7B bf16) 80 GB (40B)
RAM 32 GB 128 GB

How to run

Installation

pip install evo2
# Weights pulled from Hugging Face on first model load.

Loading and scoring

from evo2 import Evo2

model = Evo2("evo2_7b")        # or "evo2_40b" — see model table
seqs = ["ATCG" * 50, "GGGCTTAA" * 25]
ll = model.score_sequences(seqs)   # → list[float], mean per-token log-likelihood
print(ll)

Generation

out = model.generate(
    prompt_seqs=["ATGAAAGCT"],
    n_tokens=256,
    temperature=0.7,
)
print(out.sequences[0])

Models

Name Params Context VRAM (bf16) Notes
evo2_7b 7 B 1 M nt ~22 GB Default; fits on a single 24 GB+ GPU
evo2_40b 40 B 1 M nt ~78 GB H100 80 GB or multi-GPU
evo2_1b_base 1 B 8 K nt ~6 GB FP8 path requires sm_89+ (H100)

Output format

score_sequences returns a list[float] (or np.ndarray) of mean log-likelihoods, one per input sequence. More negative ⇒ less likely under the model. For variant effect, compute Δll = ll_alt - ll_ref over a fixed window.

generate returns a GenerationOutput with .sequences (list[str]), .logits (list[Tensor]), and .logprobs_mean (list[float]) — always populated, no flag required.

Decision tree

Need a DNA model?
│
├─ Per-base/per-sequence likelihood, generation → Evo 2 ✓
├─ Predict experimental tracks (expression, accessibility) → borzoi
└─ Protein, not DNA → fair-esm2 / esmfold2

Remote compute

7B/40B inference is GPU-bound (≥24 GB / 80 GB VRAM). Read compute_details({provider, mode:'read'}) for an environment with evo2 + flash-attn and a pre-cached HF weight mount, then submit:

c = host.compute.create(provider)
job = c.submitJob(
    intent="Evo2-7B score 200bp variant window — 1×GPU, ~2 min",
    inputs=[{"src": "score_evo2.py", "dstFilename": "score_evo2.py"}],
    command="python3 score_evo2.py",   # env selection is host-specific — see compute_details for your provider
    outputs=["scores.json"],
    timeoutSeconds=1800,
)
print(job.job_id)   # cell ends here — kernel never blocks on compute

Retain the exact returned job_id. Query that saved ID with the non-blocking c.attachJob(job_id).status() or .result() when its state or result is relevant; do not scan Job history. A final .result() read reports whether its follow-up was suppressed or had already been committed; otherwise the app starts the later analysis turn for an unread final result. See the remote-compute-ssh skill for details.

Inside score_evo2.py, point HF_HOME at the provider's weight-cache mount (path is in compute_details) and set HF_HUB_OFFLINE=1 so the loader doesn't try to write refs/ into a read-only mount. Weight footprint: ~15 GB (7B), ~80 GB (40B).

Typical performance

Task 7B on H100 Notes
Model load (cached) ~5-7 min First call hydrates weights
score_sequences, 200×200bp ~10-20 s After load
generate, 1×512 nt ~15 s

Troubleshooting

Symptom Cause Fix
Transformer Engine not installed No FP8 — falls back to bf16 Informational only on non-H100; ignore
OOM on load 40B on <80 GB GPU Use evo2_7b or shard with device_map
HF tries to write refs/main HF_HOME points at RO mount Set HF_HUB_OFFLINE=1
dtype mismatch in score_sequences Passing tensors not strings Pass list[str]; the API tokenises for you

Next: pair with borzoi to predict track-level effects of t

常见问题

应该使用哪种模型规格?

技能说明,7B 模型适合单张 24 GB 的 GPU,40B 模型则需要大型 GPU 或多张 GPU。

需要什么硬件?

技能说明,7B 模型至少需要 24 GB 的 GPU 显存,40B 模型推荐 80 GB。

权重会自动下载吗?

会。技能说明,首次加载模型时会从 Hugging Face 下载权重。

详情

作者的原始描述

Score, embed, and generate DNA sequences with Evo 2, a long-context genomic foundation model. Use this skill when: (1) Computing per-nucleotide or per-sequence likelihoods for variant effect scoring, (2) Embedding genomic windows for downstream classification, (3) Generating DNA conditioned on a prefix, (4) Scoring regulatory or coding regions across species.

repo: aipoch/open-science

热度

GitHub 星标
5.4k
排名
#14859
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能