tboquet commited on
Commit
fbbe495
·
verified ·
1 Parent(s): c7ba98c

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. README.md +172 -0
  3. config.json +12 -0
  4. model.safetensors +3 -0
  5. modules.json +8 -0
  6. tokenizer.json +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: jinaai/jina-embeddings-v3
3
+ language:
4
+ - multilingual
5
+ - af
6
+ - am
7
+ - ar
8
+ - as
9
+ - az
10
+ - be
11
+ - bg
12
+ - bn
13
+ - br
14
+ - bs
15
+ - ca
16
+ - cs
17
+ - cy
18
+ - da
19
+ - de
20
+ - el
21
+ - en
22
+ - eo
23
+ - es
24
+ - et
25
+ - eu
26
+ - fa
27
+ - fi
28
+ - fr
29
+ - fy
30
+ - ga
31
+ - gd
32
+ - gl
33
+ - gu
34
+ - ha
35
+ - he
36
+ - hi
37
+ - hr
38
+ - hu
39
+ - hy
40
+ - id
41
+ - is
42
+ - it
43
+ - ja
44
+ - jv
45
+ - ka
46
+ - kk
47
+ - km
48
+ - kn
49
+ - ko
50
+ - ku
51
+ - ky
52
+ - la
53
+ - lo
54
+ - lt
55
+ - lv
56
+ - mg
57
+ - mk
58
+ - ml
59
+ - mn
60
+ - mr
61
+ - ms
62
+ - my
63
+ - ne
64
+ - nl
65
+ - 'no'
66
+ - om
67
+ - or
68
+ - pa
69
+ - pl
70
+ - ps
71
+ - pt
72
+ - ro
73
+ - ru
74
+ - sa
75
+ - sd
76
+ - si
77
+ - sk
78
+ - sl
79
+ - so
80
+ - sq
81
+ - sr
82
+ - su
83
+ - sv
84
+ - sw
85
+ - ta
86
+ - te
87
+ - th
88
+ - tl
89
+ - tr
90
+ - ug
91
+ - uk
92
+ - ur
93
+ - uz
94
+ - vi
95
+ - xh
96
+ - yi
97
+ - zh
98
+ library_name: model2vec
99
+ license: mit
100
+ model_name: tboquet/m2v-jina-embeddings-v3-pca-256
101
+ tags:
102
+ - embeddings
103
+ - static-embeddings
104
+ - sentence-transformers
105
+ ---
106
+
107
+ # tboquet/m2v-jina-embeddings-v3-pca-256 Model Card
108
+
109
+ This [Model2Vec](https://github.com/MinishLab/model2vec) model is a distilled version of the [jinaai/jina-embeddings-v3](https://huggingface.co/jinaai/jina-embeddings-v3) Sentence Transformer. 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.
110
+
111
+
112
+ ## Installation
113
+
114
+ Install model2vec using pip:
115
+ ```
116
+ pip install model2vec
117
+ ```
118
+
119
+ ## Usage
120
+ Load this model using the `from_pretrained` method:
121
+ ```python
122
+ from model2vec import StaticModel
123
+
124
+ # Load a pretrained Model2Vec model
125
+ model = StaticModel.from_pretrained("tboquet/m2v-jina-embeddings-v3-pca-256")
126
+
127
+ # Compute text embeddings
128
+ embeddings = model.encode(["Example sentence"])
129
+ ```
130
+
131
+ Alternatively, you can distill your own model using the `distill` method:
132
+ ```python
133
+ from model2vec.distill import distill
134
+
135
+ # Choose a Sentence Transformer model
136
+ model_name = "BAAI/bge-base-en-v1.5"
137
+
138
+ # Distill the model
139
+ m2v_model = distill(model_name=model_name, pca_dims=256)
140
+
141
+ # Save the model
142
+ m2v_model.save_pretrained("m2v_model")
143
+ ```
144
+
145
+ ## How it works
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ ## Additional Resources
152
+
153
+ - [All Model2Vec models on the hub](https://huggingface.co/models?library=model2vec)
154
+ - [Model2Vec Repo](https://github.com/MinishLab/model2vec)
155
+ - [Model2Vec Results](https://github.com/MinishLab/model2vec?tab=readme-ov-file#results)
156
+ - [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
157
+
158
+ ## Library Authors
159
+
160
+ Model2Vec was developed by the [Minish Lab](https://github.com/MinishLab) team consisting of [Stephan Tulkens](https://github.com/stephantul) and [Thomas van Dongen](https://github.com/Pringled).
161
+
162
+ ## Citation
163
+
164
+ Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.
165
+ ```
166
+ @software{minishlab2024model2vec,
167
+ authors = {Stephan Tulkens, Thomas van Dongen},
168
+ title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
169
+ year = {2024},
170
+ url = {https://github.com/MinishLab/model2vec},
171
+ }
172
+ ```
config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "model2vec",
3
+ "architectures": [
4
+ "StaticModel"
5
+ ],
6
+ "tokenizer_name": "jinaai/jina-embeddings-v3",
7
+ "apply_pca": 256,
8
+ "apply_zipf": true,
9
+ "hidden_dim": 256,
10
+ "seq_length": 1000000,
11
+ "normalize": false
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc886a6f23725bbd8f4cec70c43546d198d41b3f3daa8f735287bae35dc88f53
3
+ size 256002136
modules.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": ".",
6
+ "type": "sentence_transformers.models.StaticEmbedding"
7
+ }
8
+ ]
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a56def25aa40facc030ea8b0b87f3688e4b3c39eb8b45d5702b3a1300fe2a20
3
+ size 17082734