speculative-simple : fix warnings

This commit is contained in:
Georgi Gerganov 2024-11-25 23:43:55 +02:00
parent 5ea6fc59e9
commit 7177eb8901
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -70,13 +70,13 @@ int main(int argc, char ** argv) {
std::vector<llama_token> inp; std::vector<llama_token> inp;
inp = common_tokenize(ctx_tgt, params.prompt, true, true); inp = common_tokenize(ctx_tgt, params.prompt, true, true);
if (llama_n_ctx(ctx_tgt) < (int) inp.size()) { if (llama_n_ctx(ctx_tgt) < (uint32_t) inp.size()) {
LOG_ERR("%s: the prompt exceeds the context size (%d tokens, ctx %d)\n", __func__, (int) inp.size(), llama_n_ctx(ctx_tgt)); LOG_ERR("%s: the prompt exceeds the context size (%d tokens, ctx %d)\n", __func__, (int) inp.size(), llama_n_ctx(ctx_tgt));
return 1; return 1;
} }
if (llama_n_batch(ctx_tgt) < (int) inp.size()) { if (llama_n_batch(ctx_tgt) < (uint32_t) inp.size()) {
LOG_ERR("%s: the prompt exceeds the batch size (%d tokens, batch %d)\n", __func__, (int) inp.size(), llama_n_batch(ctx_tgt)); LOG_ERR("%s: the prompt exceeds the batch size (%d tokens, batch %d)\n", __func__, (int) inp.size(), llama_n_batch(ctx_tgt));
return 1; return 1;
@ -154,7 +154,7 @@ int main(int argc, char ** argv) {
// evaluate the target model on [id_last, draft0, draft1, ..., draftN-1] // evaluate the target model on [id_last, draft0, draft1, ..., draftN-1]
{ {
// do not waste time on small drafts // do not waste time on small drafts
if (draft.size() < n_draft_min) { if (draft.size() < (size_t) n_draft_min) {
draft.clear(); draft.clear();
} }