Views
No views yet

[!TIP] Beetles are some of the most diverse and interesting creatures on Earth. They are found in every environment, from the deepest oceans to the highest mountains. They are also known for their ability to adapt to a wide range of habitats and lifestyles. They are small, fast and powerful!
baai/bge-base-en-v1.5, without using PCA or Zipf.[!NOTE] The brown beetle series is made for convinience in loading and using the model instead of having to run it, though it is pretty fast to reproduce anyways. If you want to use the original model by the folks from the Minish Lab, you can use the M2V_base_output model.
pip install model2vecfrom_pretrained method:1from model2vec import StaticModel
2
3# Load a pretrained Model2Vec model
4model = StaticModel.from_pretrained("bhavnicksm/brown-beetle-base-v0")
5
6# Compute text embeddings
7embeddings = model.encode(["Example sentence"])model2vec[distill] package and use the following code:1from model2vec.distill import distill
2
3# Distill the model
4m2v_model = distill(
5 model_name="bge-base-en-v1.5",
6 pca_dims=None,
7 apply_zipf=False,
8)
9
10# Save the model
11m2v_model.save_pretrained("brown-beetle-base-v1")1@software{minishlab2024model2vec,
2 authors = {Stephan Tulkens, Thomas van Dongen},
3 title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
4 year = {2024},
5 url = {https://github.com/MinishLab/model2vec},
6}