Downloads · 30 days
23
10% of all-time downloads
tomaarsen/m2v-mxbai-embed-large-v1-distilled
m2v-mxbai-embed-large-v1-distilled is a machine learning model from tomaarsen. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for model2vec. The card lists the license as mit.
Model2Vec distills a Sentence Transformer into a small, static model. This model is ideal for applications requiring fast, lightweight embeddings.
Downloads · 30 days
23
10% of all-time downloads
All-time downloads
238
Public
Repo size
121 MB
Likes
0
Public
Click a slice to open those files.
.safetensors121 MB · 99%
From the Hugging Face model README
Model2Vec distills a Sentence Transformer into a small, static model. This model is ideal for applications requiring fast, lightweight embeddings.
Install model2vec using pip:
pip install model2vec
A StaticModel can be loaded using the from_pretrained method:
from model2vec import StaticModel
model = StaticModel.from_pretrained("tomaarsen/mxbai-embed-large-v1-distilled")
embeddings = model.encode(["Example sentence"])
Alternatively, you can distill your own model using the distill method:
from model2vec.distill import distill
# Choose a Sentence Transformer model
model_name = "BAAI/bge-base-en-v1.5"
# Distill the model
m2v_model = distill(model_name=model_name, pca_dims=256)
# Save the model
m2v_model.save_pretrained("m2v_model")
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.
Please cite the Model2Vec repository if you use this model in your work.
Model2Vec was developed by the Minish Lab team consisting of Stephan Tulkens and Thomas van Dongen.