Finetune your Embedding Models in 4 lines of code 🔥

Train an embedding adapter in just 4 lines of code - again, huge credits to the Advanced Retrieval class

Installation

pip install embedding_adapter

Usage

from embedding_adapter import EmbeddingAdapter adapter = EmbeddingAdapter() EmbeddingAdapter.fit(query_embeddings, document_embeddings, labels) EmbeddingAdapter.transform(new_embeddings)

Once you’ve trained the adapter, you can use patch your pre-trained embedding model.

patch = EmbeddingAdapter.patch() adapted_embeddings = patch(original_embedding_fn("SAMPLE_TEXT"))
1 Like