File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ Notice that each `probs` is an array of length `n_probs`.
319
319
320
320
` content ` : Set the text to tokenize.
321
321
322
- Note that a special ` BOS ` token is never inserted.
322
+ ` add_special ` : Boolean indicating if special tokens, i.e. ` BOS ` , should be inserted. Default: ` false `
323
323
324
324
- ** POST** ` /detokenize ` : Convert tokens to text.
325
325
Original file line number Diff line number Diff line change @@ -3632,7 +3632,8 @@ int main(int argc, char ** argv) {
3632
3632
3633
3633
std::vector<llama_token> tokens;
3634
3634
if (body.count (" content" ) != 0 ) {
3635
- tokens = ctx_server.tokenize (body[" content" ], false );
3635
+ const bool add_special = json_value (body, " add_special" , false );
3636
+ tokens = ctx_server.tokenize (body[" content" ], add_special);
3636
3637
}
3637
3638
const json data = format_tokenizer_response (tokens);
3638
3639
return res.set_content (data.dump (), " application/json; charset=utf-8" );
You can’t perform that action at this time.
0 commit comments