Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscilloscope98 committed Dec 11, 2024
1 parent 730e8b3 commit e0cddbb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ std::string run_generate(void* void_model, int32_t* embd_inp_ptr, int32_t embd_i
printf("\nPrefill %d tokens cost %d ms.\n", embd_inp_size, duration.count());
}

std::vector<int32_t> embd(embd_inp_ptr, embd_inp_ptr + embd_inp_size); // output ids, togather with input_ids
std::vector<int32_t> embd; // output ids;
embd.push_back(token);

int token_nums = 0;
start = std::chrono::high_resolution_clock::now();
for (int i = 1; i < generation_params.max_new_token; i++){
auto logits = run_decode(void_model, embd[i+embd_inp_size-1],
auto logits = run_decode(void_model, embd[i-1],
generation_params.repetition_penalty);
int32_t token = llm_sample_token(logits, true, model_params.vocab_size);
if (std::find(tok_params.eos_token_id.begin(), tok_params.eos_token_id.end(), token) == tok_params.eos_token_id.end()){
Expand Down

0 comments on commit e0cddbb

Please sign in to comment.