A lightweight open-source package to fine-tune embedding models.
Project description
Embedding Adapter 💬 📐
Finetune embedding models in just 4 lines of code.
Quick Start ⚡
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"))
Synthetic Label Generation 🧪
No user feedback to use as labels? 🤔 Create synthetic labels with the LabelGenerator
util
from embedding_adapter.utils import LabelGenerator
generator = LabelGenerator()
generator.run()
Note: This requires an OpenAI API key saved as an OPENAI_API_KEY
env var.
License 📄
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for embedding_adapter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20b316c460beaed33a6d5e1cca181335b5b58fd91a8c9e314e955fab95ebde31 |
|
MD5 | 51ab71e3e3615cc02b8063204250e3d1 |
|
BLAKE2b-256 | c5ed444608c631d6ce2ccd45e7f42b227f21dc015723dc958c7159811c2f834b |