danaaubakirova HF Staff commited on
Commit
3913bc7
·
verified ·
1 Parent(s): dbe3aaf

Move the agent-tool subsection to the end of How to use

Browse files
Files changed (1) hide show
  1. README.md +22 -22
README.md CHANGED
@@ -110,6 +110,28 @@ print(response.choices[0].message.content)
110
 
111
  vLLM also applies the sampling defaults from `generation_config.json` unless you override them in the request.
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  ### Using Carbon-X as a tool for an agent
114
 
115
  A general-purpose assistant can call Carbon-X when a question involves DNA. Serve Carbon-X with vLLM as above, wrap it in a function, and give that function to any chat model that supports tool calling.
@@ -196,28 +218,6 @@ Tips for agent use:
196
  - **Leave exact operations to code.** Counting, coordinates and edits are more reliable in Python than in either model. For variants, compute the position and the reference and alternate bases in code and pass them as `context`.
197
  - **Cap generation length.** For next-base and continuation questions, set `max_tokens` to what you need and a client timeout, since long DNA generations are slow (see [Limitations](#limitations)).
198
 
199
- ### Tokenizer: working with DNA inputs
200
-
201
- The tokenizer switches between BPE for text and 6-mers for DNA. You can paste sequences directly into a message:
202
-
203
- ```python
204
- >>> ids = tokenizer("Describe this sequence: ACGTACGATTCA")["input_ids"]
205
- >>> tokenizer.convert_ids_to_tokens(ids)
206
- ['Describe', 'Ġthis', 'Ġsequence', ':', 'Ġ', '<dna>', 'ACGTAC', 'GATTCA', '</dna>']
207
- ```
208
-
209
- - **DNA is tagged automatically.** Runs of at least 6 A/C/G/T bases are wrapped in `<dna>…</dna>` and tokenized as 6-mers. Runs of at least 12 bases with up to 20% IUPAC ambiguity codes (`N`, `R`, `Y`, …) are tagged too. Lowercase bases are uppercased, and sequences displayed in space-separated blocks are joined. Text you have already wrapped in `<dna>…</dna>` is always tokenized as DNA. To turn off detection for a call, pass `auto_dna_tags=False` to the tokenizer or to `apply_chat_template()`.
210
- - **Only A, C, G and T form 6-mers.** A 6-mer that contains any other character, such as `N`, becomes a single `<oov>` token. To keep full resolution, filter to canonical bases first.
211
- - **Any length works.** When a sequence's length is not a multiple of 6, its last 1–5 bases are encoded with dedicated tail tokens, and decoding returns the original sequence exactly.
212
- - **DNA in responses is tagged.** The model writes DNA inside `<dna>…</dna>`. Decoding with `skip_special_tokens=True` removes the tags.
213
- - **First load needs Hub access.** On first load, the tokenizer downloads the pinned BPE vocabulary it builds on.
214
-
215
- ### Prompting tips
216
-
217
- - Put the sequence and the question in the same user message.
218
- - Include any context you already have, such as the gene, strand, coordinates or annotations. Without it, the model may guess at a sequence's identity or function.
219
- - For variant questions, give the reference and alternate sequences, or a reference sequence with the position and the base change.
220
-
221
  ## Evaluation
222
 
223
  We evaluate Carbon-X on five benchmarks that test whether a model can use DNA knowledge to predict mutation effects, identify biological features and recover DNA bases. All results below are for the released checkpoint, with thinking disabled, the default sampling settings and one sample per problem.
 
110
 
111
  vLLM also applies the sampling defaults from `generation_config.json` unless you override them in the request.
112
 
113
+ ### Tokenizer: working with DNA inputs
114
+
115
+ The tokenizer switches between BPE for text and 6-mers for DNA. You can paste sequences directly into a message:
116
+
117
+ ```python
118
+ >>> ids = tokenizer("Describe this sequence: ACGTACGATTCA")["input_ids"]
119
+ >>> tokenizer.convert_ids_to_tokens(ids)
120
+ ['Describe', 'Ġthis', 'Ġsequence', ':', 'Ġ', '<dna>', 'ACGTAC', 'GATTCA', '</dna>']
121
+ ```
122
+
123
+ - **DNA is tagged automatically.** Runs of at least 6 A/C/G/T bases are wrapped in `<dna>…</dna>` and tokenized as 6-mers. Runs of at least 12 bases with up to 20% IUPAC ambiguity codes (`N`, `R`, `Y`, …) are tagged too. Lowercase bases are uppercased, and sequences displayed in space-separated blocks are joined. Text you have already wrapped in `<dna>…</dna>` is always tokenized as DNA. To turn off detection for a call, pass `auto_dna_tags=False` to the tokenizer or to `apply_chat_template()`.
124
+ - **Only A, C, G and T form 6-mers.** A 6-mer that contains any other character, such as `N`, becomes a single `<oov>` token. To keep full resolution, filter to canonical bases first.
125
+ - **Any length works.** When a sequence's length is not a multiple of 6, its last 1–5 bases are encoded with dedicated tail tokens, and decoding returns the original sequence exactly.
126
+ - **DNA in responses is tagged.** The model writes DNA inside `<dna>…</dna>`. Decoding with `skip_special_tokens=True` removes the tags.
127
+ - **First load needs Hub access.** On first load, the tokenizer downloads the pinned BPE vocabulary it builds on.
128
+
129
+ ### Prompting tips
130
+
131
+ - Put the sequence and the question in the same user message.
132
+ - Include any context you already have, such as the gene, strand, coordinates or annotations. Without it, the model may guess at a sequence's identity or function.
133
+ - For variant questions, give the reference and alternate sequences, or a reference sequence with the position and the base change.
134
+
135
  ### Using Carbon-X as a tool for an agent
136
 
137
  A general-purpose assistant can call Carbon-X when a question involves DNA. Serve Carbon-X with vLLM as above, wrap it in a function, and give that function to any chat model that supports tool calling.
 
218
  - **Leave exact operations to code.** Counting, coordinates and edits are more reliable in Python than in either model. For variants, compute the position and the reference and alternate bases in code and pass them as `context`.
219
  - **Cap generation length.** For next-base and continuation questions, set `max_tokens` to what you need and a client timeout, since long DNA generations are slow (see [Limitations](#limitations)).
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  ## Evaluation
222
 
223
  We evaluate Carbon-X on five benchmarks that test whether a model can use DNA knowledge to predict mutation effects, identify biological features and recover DNA bases. All results below are for the released checkpoint, with thinking disabled, the default sampling settings and one sample per problem.