Skip to content

Commit 99d2d80

Browse files
author
Olivier Chafik
committed
token cast tweak for gcc
1 parent fe8c79b commit 99d2d80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/server/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ struct server_task {
392392
const std::string & word = t.at("value");
393393
auto ids = common_tokenize(vocab, word, /* add_special= */ false, /* parse_special= */ true);
394394
if (ids.size() == 1) {
395-
auto token = (llama_token) ids[0];
396-
if (std::find(params.sampling.preserved_tokens.begin(), params.sampling.preserved_tokens.end(), token) == params.sampling.preserved_tokens.end()) {
395+
auto token = ids[0];
396+
if (std::find(params.sampling.preserved_tokens.begin(), params.sampling.preserved_tokens.end(), (llama_token) token) == params.sampling.preserved_tokens.end()) {
397397
throw std::runtime_error("Grammar trigger word should be marked as preserved token: " + word);
398398
}
399399
SRV_DBG("Grammar trigger token: %d (`%s`)\n", token, word.c_str());

0 commit comments

Comments
 (0)