server : add_special option for tokenize endpoint (#7059)
This commit is contained in:
parent
ad211edef5
commit
911b3900dd
4 changed files with 48 additions and 7 deletions
|
@ -3647,7 +3647,8 @@ int main(int argc, char ** argv) {
|
|||
|
||||
std::vector<llama_token> tokens;
|
||||
if (body.count("content") != 0) {
|
||||
tokens = ctx_server.tokenize(body["content"], false);
|
||||
const bool add_special = json_value(body, "add_special", false);
|
||||
tokens = ctx_server.tokenize(body["content"], add_special);
|
||||
}
|
||||
const json data = format_tokenizer_response(tokens);
|
||||
return res.set_content(data.dump(), "application/json; charset=utf-8");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue