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

Function llama_set_adapter_cvec

llama_cpp/llama_cpp.py:2227–2242  ·  view source on GitHub ↗

Apply a loaded control vector to a llama_context, or if data is NULL, clear the currently loaded vector. n_embd should be the size of a single layer's control, and data should point to an n_embd x n_layers buffer starting from layer 1. il_start and il_end are the layer range the vect

(
    ctx: llama_context_p,
    data: CtypesPointerOrRef[ctypes.c_float],
    len: int,
    n_embd: int,
    il_start: int,
    il_end: int,
    /,
)

Source from the content-addressed store, hash-verified

2225 ctypes.c_int32,
2226)
2227def llama_set_adapter_cvec(
2228 ctx: llama_context_p,
2229 data: CtypesPointerOrRef[ctypes.c_float],
2230 len: int,
2231 n_embd: int,
2232 il_start: int,
2233 il_end: int,
2234 /,
2235) -> int:
2236 """Apply a loaded control vector to a llama_context, or if data is NULL, clear
2237 the currently loaded vector.
2238 n_embd should be the size of a single layer's control, and data should point
2239 to an n_embd x n_layers buffer starting from layer 1.
2240 il_start and il_end are the layer range the vector should apply to (both inclusive)
2241 See llama_control_vector_load in common to load a control vector."""
2242 ...
2243
2244
2245# Deprecated compatibility wrapper for the renamed llama_set_adapter_cvec().

Callers 1

llama_apply_adapter_cvecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…