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


pip install embedding_adapter


from embedding_adapter import EmbeddingAdapter adapter = EmbeddingAdapter(), 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