generate_sequence
Generate continuous DNA sequences from a starting prompt using the Evo 2 language model. Controls diversity with temperature and top-k sampling.
Instructions
Generate DNA sequence continuation using Evo 2.
Generates new DNA sequence tokens conditioned on a given prompt sequence using the Evo 2 language model. The generation process uses nucleus sampling (top-k) for controlled diversity.
Args:
prompt: Starting DNA sequence to condition generation. Should contain standard
IUPAC nucleotides (A, C, G, T, N).
checkpoint: Model checkpoint identifier. If None, uses the default checkpoint.
See list_available_checkpoints() for available options.
n_tokens: Number of new tokens to generate. Must be a positive integer.
temperature: Sampling temperature controlling randomness. Higher values (>1.0) increase
diversity; lower values (<1.0) make generation more deterministic. Must be greater than 0.
top_k: Number of highest probability nucleotides to sample from at each step.
Must be positive. Typical values: 5 (all nucleotides including N), 4 (more constrained).
Returns: Dictionary containing: - checkpoint: The checkpoint identifier used - prompt: The normalized input prompt sequence - generated_sequence: The newly generated DNA sequence - n_tokens: Number of tokens generated - temperature: Temperature value used - top_k: Top-k value used
Raises: AssertionError: If prompt is empty, n_tokens <= 0, temperature <= 0, or top_k <= 0.
Example: >>> result = generate_sequence("ATCGATCG", n_tokens=100, temperature=0.8) >>> full_sequence = result["prompt"] + result["generated_sequence"] >>> print(f"Generated sequence: {full_sequence}")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | ||
| prompt | Yes | ||
| n_tokens | No | ||
| checkpoint | No | ||
| temperature | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||