summaryrefslogtreecommitdiff
path: root/examples/server/server.cpp
diff options
context:
space:
mode:
authorJohan <JohanAR@users.noreply.github.com>2024-05-08 14:27:58 +0200
committerGitHub <noreply@github.com>2024-05-08 15:27:58 +0300
commit911b3900dded9a1cfe0f0e41b82c7a29baf3a217 (patch)
treea47b29e640d55257399a20ac1632b12d58867f9c /examples/server/server.cpp
parentad211edef5db1f1fb955874b7ca6a67bd0c88708 (diff)
server : add_special option for tokenize endpoint (#7059)
Diffstat (limited to 'examples/server/server.cpp')
-rw-r--r--examples/server/server.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/server/server.cpp b/examples/server/server.cpp
index 85ae1ad9..06c0be56 100644
--- a/examples/server/server.cpp
+++ b/examples/server/server.cpp
@@ -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");