Views
No views yet
retrieval.query task LoRA applied. It uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical.pip install model2vecfrom_pretrained method:1from model2vec import StaticModel
2
3# Load a pretrained Model2Vec model
4model = StaticModel.from_pretrained("CISCai/jina-embeddings-v3-query-distilled")
5
6# Compute text embeddings
7embeddings = model.encode(["Example sentence"])1from sentence_transformers import SentenceTransformer
2from sentence_transformers.models import StaticEmbedding
3
4# Initialize a StaticEmbedding module
5static_embedding = StaticEmbedding.from_model2vec("CISCai/jina-embeddings-v3-query-distilled")
6model = SentenceTransformer(modules=[static_embedding])
7embeddings = model.encode(["Example sentence"])distill method:1from model2vec.distill import distill
2
3# Choose a Sentence Transformer model
4model_name = "BAAI/bge-base-en-v1.5"
5
6# Distill the model
7m2v_model = distill(model_name=model_name, pca_dims=256)
8
9# Save the model
10m2v_model.save_pretrained("m2v_model")@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},
}