From de5bab65b478b9f023920bb1b1866f84c6dc7fba Mon Sep 17 00:00:00 2001 From: "The gemma.cpp Authors" Date: Wed, 26 Feb 2025 08:42:36 -0800 Subject: [PATCH] Use a set's `find` method when looking for reject tokens. PiperOrigin-RevId: 731332151 --- examples/hello_world/run.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hello_world/run.cc b/examples/hello_world/run.cc index 3951350..6d01997 100644 --- a/examples/hello_world/run.cc +++ b/examples/hello_world/run.cc @@ -99,7 +99,7 @@ int main(int argc, char** argv) { .stream_token = stream_token, .accept_token = [&](int token, float /* prob */) { - return !reject_tokens.contains(token); + return reject_tokens.find(token) == reject_tokens.end(); }, }; model.Generate(runtime_config, tokens, 0, kv_cache, timing_info);