Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +151 -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,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: Snowflake/snowflake-arctic-embed-l-v2.0
|
3 |
+
language:
|
4 |
+
- af
|
5 |
+
- ar
|
6 |
+
- az
|
7 |
+
- be
|
8 |
+
- bg
|
9 |
+
- bn
|
10 |
+
- ca
|
11 |
+
- ceb
|
12 |
+
- cs
|
13 |
+
- cy
|
14 |
+
- da
|
15 |
+
- de
|
16 |
+
- el
|
17 |
+
- en
|
18 |
+
- es
|
19 |
+
- et
|
20 |
+
- eu
|
21 |
+
- fa
|
22 |
+
- fi
|
23 |
+
- fr
|
24 |
+
- gl
|
25 |
+
- gu
|
26 |
+
- he
|
27 |
+
- hi
|
28 |
+
- hr
|
29 |
+
- ht
|
30 |
+
- hu
|
31 |
+
- hy
|
32 |
+
- id
|
33 |
+
- is
|
34 |
+
- it
|
35 |
+
- ja
|
36 |
+
- jv
|
37 |
+
- ka
|
38 |
+
- kk
|
39 |
+
- km
|
40 |
+
- kn
|
41 |
+
- ko
|
42 |
+
- ky
|
43 |
+
- lo
|
44 |
+
- lt
|
45 |
+
- lv
|
46 |
+
- mk
|
47 |
+
- ml
|
48 |
+
- mn
|
49 |
+
- mr
|
50 |
+
- ms
|
51 |
+
- my
|
52 |
+
- ne
|
53 |
+
- nl
|
54 |
+
- pa
|
55 |
+
- pl
|
56 |
+
- pt
|
57 |
+
- qu
|
58 |
+
- ro
|
59 |
+
- ru
|
60 |
+
- si
|
61 |
+
- sk
|
62 |
+
- sl
|
63 |
+
- so
|
64 |
+
- sq
|
65 |
+
- sr
|
66 |
+
- sv
|
67 |
+
- sw
|
68 |
+
- ta
|
69 |
+
- te
|
70 |
+
- th
|
71 |
+
- tl
|
72 |
+
- tr
|
73 |
+
- uk
|
74 |
+
- ur
|
75 |
+
- vi
|
76 |
+
- yo
|
77 |
+
- zh
|
78 |
+
library_name: model2vec
|
79 |
+
license: mit
|
80 |
+
model_name: FlukeTJ/snowflake-arctic-embed-l-v2.0-m2v-distilled-256
|
81 |
+
tags:
|
82 |
+
- embeddings
|
83 |
+
- static-embeddings
|
84 |
+
---
|
85 |
+
|
86 |
+
# FlukeTJ/snowflake-arctic-embed-l-v2.0-m2v-distilled-256 Model Card
|
87 |
+
|
88 |
+
This [Model2Vec](https://github.com/MinishLab/model2vec) model is a distilled version of the [Snowflake/snowflake-arctic-embed-l-v2.0](https://huggingface.co/Snowflake/snowflake-arctic-embed-l-v2.0) 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.
|
89 |
+
|
90 |
+
|
91 |
+
## Installation
|
92 |
+
|
93 |
+
Install model2vec using pip:
|
94 |
+
```
|
95 |
+
pip install model2vec
|
96 |
+
```
|
97 |
+
|
98 |
+
## Usage
|
99 |
+
Load this model using the `from_pretrained` method:
|
100 |
+
```python
|
101 |
+
from model2vec import StaticModel
|
102 |
+
|
103 |
+
# Load a pretrained Model2Vec model
|
104 |
+
model = StaticModel.from_pretrained("FlukeTJ/snowflake-arctic-embed-l-v2.0-m2v-distilled-256")
|
105 |
+
|
106 |
+
# Compute text embeddings
|
107 |
+
embeddings = model.encode(["Example sentence"])
|
108 |
+
```
|
109 |
+
|
110 |
+
Alternatively, you can distill your own model using the `distill` method:
|
111 |
+
```python
|
112 |
+
from model2vec.distill import distill
|
113 |
+
|
114 |
+
# Choose a Sentence Transformer model
|
115 |
+
model_name = "BAAI/bge-base-en-v1.5"
|
116 |
+
|
117 |
+
# Distill the model
|
118 |
+
m2v_model = distill(model_name=model_name, pca_dims=256)
|
119 |
+
|
120 |
+
# Save the model
|
121 |
+
m2v_model.save_pretrained("m2v_model")
|
122 |
+
```
|
123 |
+
|
124 |
+
## How it works
|
125 |
+
|
126 |
+
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.
|
127 |
+
|
128 |
+
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.
|
129 |
+
|
130 |
+
## Additional Resources
|
131 |
+
|
132 |
+
- [All Model2Vec models on the hub](https://huggingface.co/models?library=model2vec)
|
133 |
+
- [Model2Vec Repo](https://github.com/MinishLab/model2vec)
|
134 |
+
- [Model2Vec Results](https://github.com/MinishLab/model2vec?tab=readme-ov-file#results)
|
135 |
+
- [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
|
136 |
+
|
137 |
+
## Library Authors
|
138 |
+
|
139 |
+
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).
|
140 |
+
|
141 |
+
## Citation
|
142 |
+
|
143 |
+
Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.
|
144 |
+
```
|
145 |
+
@software{minishlab2024model2vec,
|
146 |
+
authors = {Stephan Tulkens, Thomas van Dongen},
|
147 |
+
title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
|
148 |
+
year = {2024},
|
149 |
+
url = {https://github.com/MinishLab/model2vec},
|
150 |
+
}
|
151 |
+
```
|
config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"tokenizer_name": "Snowflake/snowflake-arctic-embed-l-v2.0", "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:d580eea1f01dcc1be988ffdf9417ffe37258bc17ac236d00700d09eb0742ded5
|
3 |
+
size 256002136
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:249df0778f236f6ece390de0de746838ef25b9d6954b68c2ee71249e0a9d8fd4
|
3 |
+
size 17082799
|