tests : init prob correctly
Some checks failed
flake8 Lint / Lint (push) Waiting to run
Python Type-Check / pyright type-check (push) Has been cancelled

This commit is contained in:
Georgi Gerganov 2024-10-17 18:23:02 +03:00
parent 57fb835e5b
commit cd978508ac
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -33,7 +33,7 @@ struct sampler_tester {
cur.reserve(probs.size()); cur.reserve(probs.size());
for (llama_token token_id = 0; token_id < (llama_token)probs.size(); token_id++) { for (llama_token token_id = 0; token_id < (llama_token)probs.size(); token_id++) {
const float logit = logf(probs[token_id]); const float logit = logf(probs[token_id]);
cur.emplace_back(llama_token_data{token_id, logit, 0.0f}); cur.emplace_back(llama_token_data{token_id, logit, probs[token_id]});
} }
cur_p = llama_token_data_array { cur.data(), cur.size(), -1, false }; cur_p = llama_token_data_array { cur.data(), cur.size(), -1, false };