Use a set's `find` method when looking for reject tokens.

PiperOrigin-RevId: 731332151
This commit is contained in:
The gemma.cpp Authors 2025-02-26 08:42:36 -08:00 committed by Copybara-Service
parent 2bdf26d81d
commit de5bab65b4
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ int main(int argc, char** argv) {
.stream_token = stream_token, .stream_token = stream_token,
.accept_token = .accept_token =
[&](int token, float /* prob */) { [&](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); model.Generate(runtime_config, tokens, 0, kv_cache, timing_info);