ChristianAzinn commited on
Commit
064a15a
1 Parent(s): 229311c

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,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: avsolatorio/gist-small-embedding-v0
3
+ inference: false
4
+ language:
5
+ - en
6
+ license: mit
7
+ model_creator: avsolatorio
8
+ model_name: gist-small-embedding-v0
9
+ model_type: bert
10
+ quantized_by: ChristianAzinn
11
+ library_name: sentence-transformers
12
+ pipeline_tag: sentence-similarity
13
+ tags:
14
+ - gguf
15
+ - feature-extraction
16
+ - mteb
17
+ - sentence-similarity
18
+ - sentence-transformers
19
+ ---
20
+
21
+ # gist-small-embedding-v0-gguf
22
+
23
+ Model creator: [avsolatorio](https://huggingface.co/avsolatorio)
24
+
25
+ Original model: [gist-small-embedding-v0](https://huggingface.co/avsolatorio/gist-small-embedding-v0)
26
+
27
+ ## Original Description
28
+
29
+ The model is fine-tuned on top of the [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) using the [MEDI dataset](https://github.com/xlang-ai/instructor-embedding.git) augmented with mined triplets from the [MTEB Classification](https://huggingface.co/mteb) training dataset (excluding data from the Amazon Polarity Classification task).
30
+
31
+ The model does not require any instruction for generating embeddings. This means that queries for retrieval tasks can be directly encoded without crafting instructions.
32
+
33
+ Technical paper: [GISTEmbed: Guided In-sample Selection of Training Negatives for Text Embedding Fine-tuning](https://arxiv.org/abs/2402.16829)
34
+
35
+
36
+ ## Description
37
+
38
+ This repo contains GGUF format files for the gist-small-embedding-v0 embedding model.
39
+
40
+ 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.
41
+
42
+ This model supports up to CONTEXTLENGTH tokens of context.
43
+
44
+ ## Compatibility
45
+
46
+ 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.
47
+
48
+ # Meta-information
49
+ ## Explanation of quantisation methods
50
+ <details>
51
+ <summary>Click to see details</summary>
52
+ The methods available are:
53
+ * 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)
54
+ * 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.
55
+ * 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.
56
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
57
+ * 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
58
+ Refer to the Provided Files table below to see what files use which methods, and how.
59
+ </details>
60
+
61
+ ## Provided Files
62
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
63
+ | ---- | ---- | ---- | ---- | ---- | ----- |
64
+ | Name | Quant method | Bits | Size | Use case |
65
+ | [gist-small-embedding-v0.Q2_K.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q2_K.gguf) | Q2_K | 2 | 25.2 MB | smallest, significant quality loss - not recommended for most purposes |
66
+ | [gist-small-embedding-v0.Q3_K_S.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q3_K_S.gguf) | Q3_K_S | 3 | 25.2 MB | very small, high quality loss |
67
+ | [gist-small-embedding-v0.Q3_K_M.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q3_K_M.gguf) | Q3_K_M | 3 | 26.7 MB | very small, high quality loss |
68
+ | [gist-small-embedding-v0.Q3_K_L.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q3_K_L.gguf) | Q3_K_L | 3 | 27.7 MB | small, substantial quality loss |
69
+ | [gist-small-embedding-v0.Q4_0.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q4_0.gguf) | Q4_0 | 4 | 26.2 MB | legacy; small, very high quality loss - prefer using Q3_K_M |
70
+ | [gist-small-embedding-v0.Q4_K_S.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q4_K_S.gguf) | Q4_K_S | 4 | 28.2 MB | small, greater quality loss |
71
+ | [gist-small-embedding-v0.Q4_K_M.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q4_K_M.gguf) | Q4_K_M | 4 | 29.2 MB | medium, balanced quality - recommended |
72
+ | [gist-small-embedding-v0.Q5_0.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q5_0.gguf) | Q5_0 | 5 | 28.8 MB | legacy; medium, balanced quality - prefer using Q4_K_M |
73
+ | [gist-small-embedding-v0.Q5_K_S.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q5_K_S.gguf) | Q5_K_S | 5 | 29.7 MB | large, low quality loss - recommended |
74
+ | [gist-small-embedding-v0.Q5_K_M.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q5_K_M.gguf) | Q5_K_M | 5 | 30.5 MB | large, very low quality loss - recommended |
75
+ | [gist-small-embedding-v0.Q6_K.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q6_K.gguf) | Q6_K | 6 | 35.1 MB | very large, extremely low quality loss |
76
+ | [gist-small-embedding-v0.Q8_0.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0.Q8_0.gguf) | Q8_0 | 8 | 36.8 MB | very large, extremely low quality loss - recommended |
77
+ | [gist-small-embedding-v0.Q8_0.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0_fp16.gguf) | fp16 | 16 | 67.3 MB | enormous, pretty much the original model - not recommended |
78
+ | [gist-small-embedding-v0.Q8_0.gguf](https://huggingface.co/ChristianAzinn/gist-small-embedding-v0-gguf/blob/main/gist-small-embedding-v0_fp32.gguf) | fp32 | 32 | 134 MB | enormous, pretty much the original model - not recommended |
79
+
80
+ # Examples
81
+ ## Example Usage with `llama.cpp`
82
+
83
+ To compute a single embedding, build llama.cpp and run:
84
+ ```shell
85
+ ./embedding -ngl 99 -m [filepath-to-gguf].gguf -p 'search_query: What is TSNE?'
86
+ ```
87
+
88
+ 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.
89
+
90
+ `texts.txt`:
91
+ ```
92
+ search_query: What is TSNE?
93
+ search_query: Who is Laurens Van der Maaten?
94
+ ```
95
+
96
+ Compute multiple embeddings:
97
+ ```shell
98
+ ./embedding -ngl 99 -m [filepath-to-gguf].gguf -f texts.txt
99
+ ```
100
+
101
+ ## Example Usage with LM Studio
102
+
103
+ 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)
104
+
105
+ Once installed, open the app. The home should look like this:
106
+
107
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/QGkYvH242S0c_clPqX9Ip.png)
108
+
109
+ Search for either "ChristianAzinn" in the main search bar or go to the "Search" tab on the left menu and search the name there.
110
+
111
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/11hLos1JNMyZ1q2K9ICss.png)
112
+
113
+ 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.
114
+
115
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/hu9DuVYahQ-QpII5P8mVD.png)
116
+
117
+ 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.
118
+
119
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/7fmXkLDmGTNVyG3oqB4--.png)
120
+
121
+ 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.
122
+
123
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/OrzvqQIhB9p-aMq2G6Lxd.png)
124
+
125
+ 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.
126
+
127
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/TM4dO4DFP1xqZD1GWBqeI.png)
128
+
129
+ All that's left to do is to hit the "Start Server" button:
130
+
131
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/6TZvnX84rZKZ0TwVVLFnw.png)
132
+
133
+ 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.
134
+
135
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6584f042b378d311dccea501/kD47WaH-tzpr4qaAm-pMn.png)
136
+
137
+ Example curl request to the API endpoint:
138
+ ```shell
139
+ curl http://localhost:1234/v1/embeddings \
140
+ -H "Content-Type: application/json" \
141
+ -d '{
142
+ "input": "Your text string goes here",
143
+ "model": "model-identifier-here"
144
+ }'
145
+ ```
146
+
147
+ For more information, see the LM Studio [text embedding documentation](https://lmstudio.ai/docs/text-embeddings).
148
+
149
+
150
+ ## Acknowledgements
151
+
152
+ Thanks to the LM Studio team and everyone else working on open-source AI.
153
+
154
+ 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).
gist-small-embedding-v0.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00aca898f8c52663eba7818e5cf2d3016a6811aa49f4940b4109f57a23f6bfcb
3
+ size 25250080
gist-small-embedding-v0.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:602c0a0e950fe56f49ba1b9a69b3e4cda2593844ad210bd9d72da39bf8da47fc
3
+ size 27738400
gist-small-embedding-v0.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5dd3d5949dbf14e77c963581dbd08e28ef2d675cfeef068fc9ed5df0914ecb5d
3
+ size 26724640
gist-small-embedding-v0.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdb133169d2906cf695efc6245423b20e4542cb1854af4b1119bba94fe570b04
3
+ size 25250080
gist-small-embedding-v0.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:565ab5315778ce6ef20d729f8c97192c39f9bd8e4dec3fbb40c6b2b9911cc9eb
3
+ size 26190112
gist-small-embedding-v0.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14d98d61665fd4810508d70844bde622507757212ab67e6a29a70ed5e18b4fb8
3
+ size 29203744
gist-small-embedding-v0.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d77eba9e1f71fc6124bc819d82eec35d90987a41c502386be6498ebdf58be15
3
+ size 28217632
gist-small-embedding-v0.Q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b275882249d17a6bc4992321ccb4a6c6bafc683cb444e9b4e272078d03aeda1
3
+ size 28844320
gist-small-embedding-v0.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7add89635368b49d403534639fc5302dde706a7109076ffc808a03418bfc4f2c
3
+ size 30475552
gist-small-embedding-v0.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43c5817a966702870f8867060cbda0a948ba6a70bc555b8a93dec8744956d1db
3
+ size 29729056
gist-small-embedding-v0.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e6c0e94da465654e881df95d7deeb803ef30da46efc61ded3b9effe7ac4e8ba
3
+ size 35092768
gist-small-embedding-v0.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83749085b19282ff80c46033a155285abdfdee88056bb1b193a8e548f025c4a9
3
+ size 36806944
gist-small-embedding-v0_fp16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4554a5b7cd3cb57009a790b5e3cca046bb1f12acfc50abc05afe834673ae4eb
3
+ size 67308160
gist-small-embedding-v0_fp32.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8ef6af0c26d80e235a621ce68f0a354a586f6e0c8607f58b3d604fa6550f251
3
+ size 133609600