MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / llama_batch_add

Function llama_batch_add

common/common.cpp:945–960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943}
944
945void llama_batch_add(
946 struct llama_batch & batch,
947 llama_token id,
948 llama_pos pos,
949 const std::vector<llama_seq_id> & seq_ids,
950 bool logits) {
951 batch.token [batch.n_tokens] = id;
952 batch.pos [batch.n_tokens] = pos,
953 batch.n_seq_id[batch.n_tokens] = seq_ids.size();
954 for (size_t i = 0; i < seq_ids.size(); ++i) {
955 batch.seq_id[batch.n_tokens][i] = seq_ids[i];
956 }
957 batch.logits [batch.n_tokens] = logits;
958
959 batch.n_tokens++;
960}
961
962std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_params(gpt_params & params) {
963 auto mparams = llama_model_params_from_gpt_params(params);

Callers 8

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
update_system_promptMethod · 0.85
ingest_imagesMethod · 0.85
update_slotsMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

mainFunction · 0.68