MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / llama_get_logits

Function llama_get_logits

llama_cpp/llama_cpp.py:3191–3200  ·  view source on GitHub ↗

Token logits obtained from the last call to llama_decode() The logits for which llama_batch.logits[i] != 0 are stored contiguously in the order they have appeared in the batch. Rows: number of tokens for which llama_batch.logits[i] != 0 Cols: n_vocab Returns: Pointer to

(ctx: llama_context_p, /)

Source from the content-addressed store, hash-verified

3189 "llama_get_logits", [llama_context_p_ctypes], ctypes.POINTER(ctypes.c_float)
3190)
3191def llama_get_logits(ctx: llama_context_p, /) -> CtypesArray[ctypes.c_float]:
3192 """Token logits obtained from the last call to llama_decode()
3193 The logits for which llama_batch.logits[i] != 0 are stored contiguously
3194 in the order they have appeared in the batch.
3195 Rows: number of tokens for which llama_batch.logits[i] != 0
3196 Cols: n_vocab
3197
3198 Returns:
3199 Pointer to the logits buffer of shape (n_tokens, n_vocab)"""
3200 ...
3201
3202
3203# // Logits for the ith token. For positive indices, Equivalent to:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…