mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-09 16:44:35 +00:00
server : add parse_special option to /tokenize endpoint (#14783)
This commit is contained in:
parent
2be60cbc27
commit
b4efd77f8a
2 changed files with 4 additions and 1 deletions
|
@ -4516,9 +4516,10 @@ int main(int argc, char ** argv) {
|
|||
json tokens_response = json::array();
|
||||
if (body.count("content") != 0) {
|
||||
const bool add_special = json_value(body, "add_special", false);
|
||||
const bool parse_special = json_value(body, "parse_special", true);
|
||||
const bool with_pieces = json_value(body, "with_pieces", false);
|
||||
|
||||
llama_tokens tokens = tokenize_mixed(ctx_server.vocab, body.at("content"), add_special, true);
|
||||
llama_tokens tokens = tokenize_mixed(ctx_server.vocab, body.at("content"), add_special, parse_special);
|
||||
|
||||
if (with_pieces) {
|
||||
for (const auto& token : tokens) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue