Apply suggestions from code review

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
Alexey Parfenov 2024-02-09 16:28:18 +00:00 committed by GitHub
parent cfaa525804
commit f6fd1a97d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -641,7 +641,7 @@ struct llama_server_context
continue; continue;
} }
if(el[0].is_number_integer()) if (el[0].is_number_integer())
{ {
llama_token tok = el[0].get<llama_token>(); llama_token tok = el[0].get<llama_token>();
if (tok >= 0 && tok < n_vocab) if (tok >= 0 && tok < n_vocab)
@ -652,7 +652,7 @@ struct llama_server_context
else if (el[0].is_string()) else if (el[0].is_string())
{ {
auto toks = llama_tokenize(model, el[0].get<std::string>(), false); auto toks = llama_tokenize(model, el[0].get<std::string>(), false);
for(auto tok : toks) for (auto tok : toks)
{ {
slot->sparams.logit_bias[tok] = bias; slot->sparams.logit_bias[tok] = bias;
} }