llama_apply_adapter_cvec function

  1. @Native<Int32 Function(Pointer<llama_context>, Pointer<Float>, Size, Int32, Int32, Int32)>(ffi.Pointer<llama_context>, ffi.Pointer<ffi.Float>, ffi.Size, ffi.Int32, ffi.Int32, ffi.Int32)>()
int llama_apply_adapter_cvec(
  1. Pointer<llama_context> ctx,
  2. Pointer<Float> data,
  3. int len,
  4. int n_embd,
  5. int il_start,
  6. int il_end,
)

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 vector should apply to (both inclusive) See llama_control_vector_load in common to load a control vector.

Implementation

@ffi.Native<
  ffi.Int32 Function(
    ffi.Pointer<llama_context>,
    ffi.Pointer<ffi.Float>,
    ffi.Size,
    ffi.Int32,
    ffi.Int32,
    ffi.Int32,
  )
>()
external int llama_apply_adapter_cvec(
  ffi.Pointer<llama_context> ctx,
  ffi.Pointer<ffi.Float> data,
  int len,
  int n_embd,
  int il_start,
  int il_end,
);