Skip to content

Generate control vector using llama.cpp #6880

Closed
@ngxson

Description

@ngxson

Motivation

Support for control vector is added in #5970 , but to generate the vector, users must run python code (which uses huggingface API instead of llama.cpp)

Possible Implementation

By looking at https://github.com/vgel/repeng/blob/main/repeng/extract.py , we can see some key steps that need to be adapted to cpp:

  • batched_get_hiddens returns a list of embedding vectors from hidden layers. This can be done in llama.cpp using eval callback
  • For the moment, we can't find any lightweight implementation of Principal component analysis (PCA) in cpp. An idea would be to replace it with this UMAP C++ implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions