| 10595 | } |
| 10596 | |
| 10597 | int 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 | |
| 10614 | void llama_set_n_threads(struct llama_context * ctx, uint32_t n_threads, uint32_t n_threads_batch) { |
| 10615 | ctx->cparams.n_threads = n_threads; |
nothing calls this directly
no test coverage detected