dark-potion-base-150M Model Card
This Model2Vec model is a distilled version of a dark secret model 🤫. This model was created by Bhavnick Minhas using the Model2Vec library, as a proof of concept, answering the question: "Can we distill static embeddings from a Sentence Embedding API, without any access to the original model?".
The original model is a proprietary model, and the only information we have about it is the tokenizer.json file, which contains the vocabulary and special tokens. We use this information to create a new tokenizer, and then use the Model2Vec library to distill a static embedding model from the API. Note that this is perfectly legal as embeddings are owned by the user as long as they are paid for, and the user is free to use them in any way they want.
All credit goes to the Minish Lab team for the original model and the Model2Vec library.
Installation
Install model2vec using pip:
pip install model2vec
Usage
Load this model using the from_pretrained
method:
from model2vec import StaticModel
# Load a pretrained Model2Vec model
model = StaticModel.from_pretrained("bhavnicksm/dark-potion-base-150M")
# Compute text embeddings
embeddings = model.encode(["Example sentence"])
How it works
Model2vec creates a small, fast, and powerful model that outperforms other static embedding models by a large margin on all tasks we could find, while being much faster to create than traditional static embedding models such as GloVe. Best of all, you don't need any data to distill a model using Model2Vec.
It works by passing a vocabulary through a sentence transformer model, then reducing the dimensionality of the resulting embeddings using PCA, and finally weighting the embeddings using zipf weighting. During inference, we simply take the mean of all token embeddings occurring in a sentence.
Additional Resources
Library Authors
Model2Vec was developed by the Minish Lab team consisting of Stephan Tulkens and Thomas van Dongen.
Citation
Please cite the Model2Vec repository if you use this model in your work.
@software{minishlab2024model2vec,
authors = {Stephan Tulkens, Thomas van Dongen},
title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
year = {2024},
url = {https://github.com/MinishLab/model2vec},
}
- Downloads last month
- 24