tomaarsen HF staff commited on
Commit
eba5f63
1 Parent(s): 6b211a2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +68 -68
README.md CHANGED
@@ -1,69 +1,69 @@
1
- ---
2
- base_model: mixedbread-ai/mxbai-embed-large-v1
3
- language:
4
- - en
5
- library_name: model2vec
6
- license: mit
7
- model_name: tomaarsen/mxbai-embed-large-v1-distilled
8
- tags:
9
- - embeddings
10
- - static-embeddings
11
- ---
12
-
13
- # tomaarsen/mxbai-embed-large-v1-distilled Model Card
14
-
15
- Model2Vec distills a Sentence Transformer into a small, static model.
16
- This model is ideal for applications requiring fast, lightweight embeddings.
17
-
18
-
19
-
20
- ## Installation
21
-
22
- Install model2vec using pip:
23
- ```
24
- pip install model2vec
25
- ```
26
-
27
- ## Usage
28
- A StaticModel can be loaded using the `from_pretrained` method:
29
- ```python
30
- from model2vec import StaticModel
31
-
32
- model = StaticModel.from_pretrained("tomaarsen/mxbai-embed-large-v1-distilled")
33
-
34
- embeddings = model.encode(["Example sentence"])
35
- ```
36
-
37
- Alternatively, you can distill your own model using the `distill` method:
38
- ```python
39
- from model2vec.distill import distill
40
-
41
- # Choose a Sentence Transformer model
42
- model_name = "BAAI/bge-base-en-v1.5"
43
-
44
- # Distill the model
45
- m2v_model = distill(model_name=model_name, pca_dims=256)
46
-
47
- # Save the model
48
- m2v_model.save_pretrained("m2v_model")
49
- ```
50
-
51
- ## How it works
52
-
53
- 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.
54
-
55
- 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.
56
-
57
- ## Citation
58
-
59
- Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.
60
-
61
- ## Additional Resources
62
-
63
- - [Model2Vec Repo](https://github.com/MinishLab/model2vec)
64
- - [Model2Vec Results](https://github.com/MinishLab/model2vec?tab=readme-ov-file#results)
65
- - [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
66
-
67
- ## Model Authors
68
-
69
  Model2Vec was developed by the [Minish Lab](https://github.com/MinishLab) team consisting of Stephan Tulkens and Thomas van Dongen.
 
1
+ ---
2
+ base_model: mixedbread-ai/mxbai-embed-large-v1
3
+ language:
4
+ - en
5
+ library_name: model2vec
6
+ license: mit
7
+ model_name: tomaarsen/mxbai-embed-large-v1-distilled
8
+ tags:
9
+ - embeddings
10
+ - static-embeddings
11
+ ---
12
+
13
+ # tomaarsen/mxbai-embed-large-v1-distilled Model Card
14
+
15
+ Model2Vec distills a Sentence Transformer into a small, static model.
16
+ This model is ideal for applications requiring fast, lightweight embeddings.
17
+
18
+
19
+
20
+ ## Installation
21
+
22
+ Install model2vec using pip:
23
+ ```
24
+ pip install model2vec
25
+ ```
26
+
27
+ ## Usage
28
+ A StaticModel can be loaded using the `from_pretrained` method:
29
+ ```python
30
+ from model2vec import StaticModel
31
+
32
+ model = StaticModel.from_pretrained("tomaarsen/mxbai-embed-large-v1-distilled")
33
+
34
+ embeddings = model.encode(["Example sentence"])
35
+ ```
36
+
37
+ Alternatively, you can distill your own model using the `distill` method:
38
+ ```python
39
+ from model2vec.distill import distill
40
+
41
+ # Choose a Sentence Transformer model
42
+ model_name = "BAAI/bge-base-en-v1.5"
43
+
44
+ # Distill the model
45
+ m2v_model = distill(model_name=model_name, pca_dims=256)
46
+
47
+ # Save the model
48
+ m2v_model.save_pretrained("m2v_model")
49
+ ```
50
+
51
+ ## How it works
52
+
53
+ 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.
54
+
55
+ 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.
56
+
57
+ ## Citation
58
+
59
+ Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.
60
+
61
+ ## Additional Resources
62
+
63
+ - [Model2Vec Repo](https://github.com/MinishLab/model2vec)
64
+ - [Model2Vec Results](https://github.com/MinishLab/model2vec?tab=readme-ov-file#results)
65
+ - [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
66
+
67
+ ## Model Authors
68
+
69
  Model2Vec was developed by the [Minish Lab](https://github.com/MinishLab) team consisting of Stephan Tulkens and Thomas van Dongen.