ChristianAzinn commited on
Commit
8046294
1 Parent(s): 3a4e52a

Upload folder using huggingface_hub

Browse files
.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
+ *.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: intfloat/e5-small-v2
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: mit
7
+ model_creator: intfloat
8
+ model_name: e5-small-v2
9
+ model_type: bert
10
+ quantized_by: ChristianAzinn
11
+ library_name: sentence-transformers
12
+ pipeline_tag: sentence-similarity
13
+ tags:
14
+ - gguf
15
+ - mteb
16
+ - Sentence Transformers
17
+ - sentence-similarity
18
+ - sentence-transformers
19
+ ---
20
+
21
+ # e5-small-v2-gguf
22
+
23
+ Model creator: [intfloat](https://huggingface.co/intfloat)
24
+
25
+ Original model: [e5-small-v2](https://huggingface.co/intfloat/e5-small-v2)
26
+
27
+ ## Original Description
28
+
29
+ [Text Embeddings by Weakly-Supervised Contrastive Pre-training](https://arxiv.org/pdf/2212.03533.pdf).
30
+ Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei, arXiv 2022
31
+
32
+ This model has 12 layers and the embedding size is 384.
33
+
34
+ ## Description
35
+
36
+ This repo contains GGUF format files for the e5-small-v2 embedding model.
37
+
38
+ These files were converted and quantized with llama.cpp [PR 5500](https://github.com/ggerganov/llama.cpp/pull/5500), commit [34aa045de](https://github.com/ggerganov/llama.cpp/pull/5500/commits/34aa045de44271ff7ad42858c75739303b8dc6eb), on a consumer RTX 4090.
39
+
40
+ This model supports up to 512 tokens of context.
41
+
42
+ ## Compatibility
43
+
44
+ These files are compatible with [llama.cpp](https://github.com/ggerganov/llama.cpp) as of commit [4524290e8](https://github.com/ggerganov/llama.cpp/commit/4524290e87b8e107cc2b56e1251751546f4b9051), as well as [LM Studio](https://lmstudio.ai/) as of version 0.2.19.
45
+
46
+ # Meta-information
47
+ ## Explanation of quantisation methods
48
+ <details>
49
+ <summary>Click to see details</summary>
50
+ The methods available are:
51
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
52
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
53
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
54
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
55
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
56
+ Refer to the Provided Files table below to see what files use which methods, and how.
57
+ </details>
58
+
59
+ ## Provided Files
60
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
61
+ | ---- | ---- | ---- | ---- | ---- | ----- |
62
+ | Name | Quant method | Bits | Size | Use case |
63
+ | [e5-small-v2.Q2_K.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q2_K.gguf) | Q2_K | 2 | 25.2 MB | smallest, significant quality loss - not recommended for most purposes |
64
+ | [e5-small-v2.Q3_K_S.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q3_K_S.gguf) | Q3_K_S | 3 | 25.2 MB | very small, high quality loss |
65
+ | [e5-small-v2.Q3_K_M.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q3_K_M.gguf) | Q3_K_M | 3 | 26.7 MB | very small, high quality loss |
66
+ | [e5-small-v2.Q3_K_L.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q3_K_L.gguf) | Q3_K_L | 3 | 27.7 MB | small, substantial quality loss |
67
+ | [e5-small-v2.Q4_0.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q4_0.gguf) | Q4_0 | 4 | 26.2 MB | legacy; small, very high quality loss - prefer using Q3_K_M |
68
+ | [e5-small-v2.Q4_K_S.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q4_K_S.gguf) | Q4_K_S | 4 | 28.2 MB | small, greater quality loss |
69
+ | [e5-small-v2.Q4_K_M.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q4_K_M.gguf) | Q4_K_M | 4 | 29.2 MB | medium, balanced quality - recommended |
70
+ | [e5-small-v2.Q5_0.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q5_0.gguf) | Q5_0 | 5 | 28.8 MB | legacy; medium, balanced quality - prefer using Q4_K_M |
71
+ | [e5-small-v2.Q5_K_S.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q5_K_S.gguf) | Q5_K_S | 5 | 29.7 MB | large, low quality loss - recommended |
72
+ | [e5-small-v2.Q5_K_M.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q5_K_M.gguf) | Q5_K_M | 5 | 30.5 MB | large, very low quality loss - recommended |
73
+ | [e5-small-v2.Q6_K.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q6_K.gguf) | Q6_K | 6 | 35.1 MB | very large, extremely low quality loss |
74
+ | [e5-small-v2.Q8_0.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2.Q8_0.gguf) | Q8_0 | 8 | 36.8 MB | very large, extremely low quality loss - recommended |
75
+ | [e5-small-v2.Q8_0.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2_fp16.gguf) | fp16 | 16 | 67.3 MB | enormous, pretty much the original model - not recommended |
76
+ | [e5-small-v2.Q8_0.gguf](https://huggingface.co/ChristianAzinn/e5-small-v2-gguf/blob/main/e5-small-v2_fp32.gguf) | fp32 | 32 | 134 MB | enormous, pretty much the original model - not recommended |
77
+
78
+ # Examples
79
+ ## Example Usage with `llama.cpp`
80
+
81
+ To compute a single embedding, build llama.cpp and run:
82
+ ```shell
83
+ ./embedding -ngl 99 -m [filepath-to-gguf].gguf -p 'search_query: What is TSNE?'
84
+ ```
85
+
86
+ You can also submit a batch of texts to embed, as long as the total number of tokens does not exceed the context length. Only the first three embeddings are shown by the `embedding` example.
87
+
88
+ `texts.txt`:
89
+ ```
90
+ search_query: What is TSNE?
91
+ search_query: Who is Laurens Van der Maaten?
92
+ ```
93
+
94
+ Compute multiple embeddings:
95
+ ```shell
96
+ ./embedding -ngl 99 -m [filepath-to-gguf].gguf -f texts.txt
97
+ ```
98
+
99
+ ## Example Usage with LM Studio
100
+
101
+ Download the 0.2.19 beta build from here: [Windows](https://releases.lmstudio.ai/windows/0.2.19/beta/LM-Studio-0.2.19-Setup-Preview-1.exe) [MacOS](https://releases.lmstudio.ai/mac/arm64/0.2.19/beta/LM-Studio-darwin-arm64-0.2.19-Preview-1.zip) [Linux](https://releases.lmstudio.ai/linux/0.2.19/beta/LM_Studio-0.2.19-Preview-1.AppImage)
102
+
103
+ Once installed, open the app. The home should look like this:
104
+
105
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/QGkYvH242S0c_clPqX9Ip.png)
106
+
107
+ Search for either "ChristianAzinn" in the main search bar or go to the "Search" tab on the left menu and search the name there.
108
+
109
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/11hLos1JNMyZ1q2K9ICss.png)
110
+
111
+ Select your model from those that appear (this example uses `bge-small-en-v1.5-gguf`) and select which quantization you want to download. Since this model is pretty small, I recommend Q8_0, if not f16/32. Generally, the lower you go in the list (or the bigger the number gets), the larger the file and the better the performance.
112
+
113
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/hu9DuVYahQ-QpII5P8mVD.png)
114
+
115
+ You will see a green checkmark and the word "Downloaded" once the model has successfully downloaded, which can take some time depending on your network speeds.
116
+
117
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/7fmXkLDmGTNVyG3oqB4--.png)
118
+
119
+ Once this model is finished downloading, navigate to the "Local Server" tab on the left menu and open the loader for text embedding models. This loader does not appear before version 0.2.19, so ensure you downloaded the correct version.
120
+
121
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/OrzvqQIhB9p-aMq2G6Lxd.png)
122
+
123
+ Select the model you just downloaded from the dropdown that appears to load it. You may need to play with configuratios in the right-side menu, such as GPU offload if it doesn't fit entirely into VRAM.
124
+
125
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/TM4dO4DFP1xqZD1GWBqeI.png)
126
+
127
+ All that's left to do is to hit the "Start Server" button:
128
+
129
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/6TZvnX84rZKZ0TwVVLFnw.png)
130
+
131
+ And if you see text like that shown below in the console, you're good to go! You can use this as a drop-in replacement for the OpenAI embeddings API in any application that requires it, or you can query the endpoint directly to test it out.
132
+
133
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/kD47WaH-tzpr4qaAm-pMn.png)
134
+
135
+ Example curl request to the API endpoint:
136
+ ```shell
137
+ curl http://localhost:1234/v1/embeddings \
138
+ -H "Content-Type: application/json" \
139
+ -d '{
140
+ "input": "Your text string goes here",
141
+ "model": "model-identifier-here"
142
+ }'
143
+ ```
144
+
145
+ For more information, see the LM Studio [text embedding documentation](https://lmstudio.ai/docs/text-embeddings).
146
+
147
+
148
+ ## Acknowledgements
149
+
150
+ Thanks to the LM Studio team and everyone else working on open-source AI.
151
+
152
+ This README is inspired by that of [nomic-ai-embed-text-v1.5-gguf](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-gguf), another excellent embedding model, and those of the legendary [TheBloke](https://huggingface.co/TheBloke).
e5-small-v2.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e832a208937f2075e7ed98bb6301fff59d0cf7392143cc901116633731286f0e
3
+ size 25250080
e5-small-v2.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:886b105d96f665258012f4db1b1943dbf3704784c5830f798d3a59282cc9876c
3
+ size 27738400
e5-small-v2.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40e9bb78b83ee66075e1909a421eaa63b458cd6f07e704ec1e588b4d8ee2dd7e
3
+ size 26724640
e5-small-v2.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a18636bc7dde03d41783d0f94f2a778bba7d8cc2f49f4235f4fc47826e88373
3
+ size 25250080
e5-small-v2.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9bad174847271a5bb22049b673cf1fc2db32b36ff3a0c8a1e7c137235bd9130b
3
+ size 26190112
e5-small-v2.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9803db6ceb7cb5cdf4a62c07d32e15d88a9d8b08e903db2a4d08da524d0ab7c
3
+ size 29203744
e5-small-v2.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df4abec65299dc99a7f962aee2dc4d38122d9a78b31b6a705f397859f324d397
3
+ size 28217632
e5-small-v2.Q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09f2fe207075489e88a06b3df7b3d3000a3b0acc03320ef88f8566db53e774d7
3
+ size 28844320
e5-small-v2.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdc5510299e49c9982951644c142f919b71f1ab94210778d61fe3da65eadc14a
3
+ size 30475552
e5-small-v2.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b317e6bab1dcee08fd24c9ab5f5f9b78faa9686c04be7c1d6cf5599e1da75f9
3
+ size 29729056
e5-small-v2.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d33799b9408651815cf336325a879c44067f1854e1ce4494ba0635f893749e07
3
+ size 35092768
e5-small-v2.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8cf0342d46268235a28f1e0ce5c85e0b9b9b1a8b0789cb9e17139d0c01e2bec
3
+ size 36806944
e5-small-v2_fp16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96009a2c57084740a0bda4215940b7027042e4d8790655514dc84aaaf5fa065c
3
+ size 67308128
e5-small-v2_fp32.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39c5d74b61ae37188edf634c9da2dbad0a94e9d92a719634f6159d6531e29795
3
+ size 133609568