File size: 3,171 Bytes
2463af1
ca8389c
 
 
 
2463af1
ca8389c
 
 
 
 
2463af1
ca8389c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---

base_model: mixedbread-ai/mxbai-embed-2d-large-v1
language:
- en
library_name: model2vec
license: mit
model_name: red-beetle-base-v0
tags:
- embeddings
- static-embeddings
- sentence-transformers
---

# 🪲 red-beetle-base-v0 Model Card

<div align="center">
  <img width="75%" alt="Beetle logo" src="./assets/beetle_logo.png">
</div>

> [!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!

The beetle series of models are made as good starting points for Static Embedding training (via TokenLearn or Fine-tuning), as well as decent Static Embedding models. Each beetle model is made to be an improvement over the original **M2V_base_output** model in some way, and that's the threshold we set for each model (except the brown beetle series, which is the original model).

This model has been distilled from `mixedbread-ai/mxbai-embed-2d-large-v1`, without PCA or Zipf. This model is a good initialization point for further training.

## Version Information

- **red-beetle-base-v0**: The original model, without using PCA or Zipf. The lack of PCA and Zipf also makes this a decent model for further training.
- **red-beetle-base-v1**: The original model, without PCA but with Zipf re-weighting. It has 1024 dimension embeddings.
- **red-beetle-small-v1**: A smaller version of the original model, with PCA at 384 dimensions and Zipf re-weighting.

## Installation

Install model2vec using pip:

```bash

pip install model2vec

```

## Usage

Load this model using the `from_pretrained` method:

```python

from model2vec import StaticModel



# Load a pretrained Model2Vec model

model = StaticModel.from_pretrained("bhavnicksm/red-beetle-base-v0")



# Compute text embeddings

embeddings = model.encode(["Example sentence"])

```

Read more about the Model2Vec library [here](https://github.com/MinishLab/model2vec).

## Reproduce this model

To reproduce this model, you must install the `model2vec[distill]` package and use the following code:

```python

from model2vec.distill import distill



# Distill the model

m2v_model = distill(

    model_name="mixedbread-ai/mxbai-embed-2d-large-v1",

    pca_dims=None,

    apply_zipf=False,

)



# Save the model

m2v_model.save_pretrained("red-beetle-base-v0")

```

## Comparison with other models

Coming soon...

## Acknowledgements

This model is made using the [Model2Vec](https://github.com/MinishLab/model2vec) library. Credit goes to the [Minish Lab](https://github.com/MinishLab) team for developing this library.

## Citation

Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.

```bibtex

@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},

}

```