jester6136
commited on
Commit
•
9c80216
1
Parent(s):
61b7fd9
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +171 -0
- config.json +1 -0
- model.safetensors +3 -0
- 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,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: intfloat/multilingual-e5-large
|
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: jester6136/multilingual-e5-large-m2v
|
101 |
+
tags:
|
102 |
+
- embeddings
|
103 |
+
- static-embeddings
|
104 |
+
---
|
105 |
+
|
106 |
+
# jester6136/multilingual-e5-large-m2v Model Card
|
107 |
+
|
108 |
+
This [Model2Vec](https://github.com/MinishLab/model2vec) model is a distilled version of the [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) 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.
|
109 |
+
|
110 |
+
|
111 |
+
## Installation
|
112 |
+
|
113 |
+
Install model2vec using pip:
|
114 |
+
```
|
115 |
+
pip install model2vec
|
116 |
+
```
|
117 |
+
|
118 |
+
## Usage
|
119 |
+
Load this model using the `from_pretrained` method:
|
120 |
+
```python
|
121 |
+
from model2vec import StaticModel
|
122 |
+
|
123 |
+
# Load a pretrained Model2Vec model
|
124 |
+
model = StaticModel.from_pretrained("jester6136/multilingual-e5-large-m2v")
|
125 |
+
|
126 |
+
# Compute text embeddings
|
127 |
+
embeddings = model.encode(["Example sentence"])
|
128 |
+
```
|
129 |
+
|
130 |
+
Alternatively, you can distill your own model using the `distill` method:
|
131 |
+
```python
|
132 |
+
from model2vec.distill import distill
|
133 |
+
|
134 |
+
# Choose a Sentence Transformer model
|
135 |
+
model_name = "BAAI/bge-base-en-v1.5"
|
136 |
+
|
137 |
+
# Distill the model
|
138 |
+
m2v_model = distill(model_name=model_name, pca_dims=256)
|
139 |
+
|
140 |
+
# Save the model
|
141 |
+
m2v_model.save_pretrained("m2v_model")
|
142 |
+
```
|
143 |
+
|
144 |
+
## How it works
|
145 |
+
|
146 |
+
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.
|
147 |
+
|
148 |
+
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.
|
149 |
+
|
150 |
+
## Additional Resources
|
151 |
+
|
152 |
+
- [All Model2Vec models on the hub](https://huggingface.co/models?library=model2vec)
|
153 |
+
- [Model2Vec Repo](https://github.com/MinishLab/model2vec)
|
154 |
+
- [Model2Vec Results](https://github.com/MinishLab/model2vec?tab=readme-ov-file#results)
|
155 |
+
- [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
|
156 |
+
|
157 |
+
## Library Authors
|
158 |
+
|
159 |
+
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).
|
160 |
+
|
161 |
+
## Citation
|
162 |
+
|
163 |
+
Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.
|
164 |
+
```
|
165 |
+
@software{minishlab2024model2vec,
|
166 |
+
authors = {Stephan Tulkens, Thomas van Dongen},
|
167 |
+
title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
|
168 |
+
year = {2024},
|
169 |
+
url = {https://github.com/MinishLab/model2vec},
|
170 |
+
}
|
171 |
+
```
|
config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"tokenizer_name": "intfloat/multilingual-e5-large", "apply_pca": 256, "apply_zipf": true, "hidden_dim": 256, "seq_length": 1000000, "normalize": false}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89752d61e6f8ff619aba925735ed18e42872cbc61756fc46061fec5e8fae509b
|
3 |
+
size 256002136
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3a56def25aa40facc030ea8b0b87f3688e4b3c39eb8b45d5702b3a1300fe2a20
|
3 |
+
size 17082734
|