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

Function llama_eval_embd

llama.cpp:10597–10612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10595}
10596
10597int llama_eval_embd(
10598 struct llama_context * ctx,
10599 float * embd,
10600 int32_t n_tokens,
10601 int n_past) {
10602 llama_kv_cache_seq_rm(ctx->kv_self, -1, n_past, -1);
10603
10604 llama_batch batch = { n_tokens, nullptr, embd, nullptr, nullptr, nullptr, nullptr, n_past, 1, 0, };
10605
10606 const int ret = llama_decode_internal(*ctx, batch);
10607 if (ret < 0) {
10608 LLAMA_LOG_ERROR("%s: failed to decode, ret = %d\n", __func__, ret);
10609 }
10610
10611 return ret;
10612}
10613
10614void llama_set_n_threads(struct llama_context * ctx, uint32_t n_threads, uint32_t n_threads_batch) {
10615 ctx->cparams.n_threads = n_threads;

Callers

nothing calls this directly

Calls 2

llama_kv_cache_seq_rmFunction · 0.85
llama_decode_internalFunction · 0.85

Tested by

no test coverage detected