MaziyarPanahi commited on
Commit
d8695e2
1 Parent(s): 7efeed4

Upload folder using huggingface_hub (#1)

Browse files

- 9075ff5b5c10cf851ae44f46ea780636ee7b8ff91f9d13df2ffed609ea641dc9 (97150881466b3e1c55340cbbf57298c52d89ee16)
- 371bf806a67d78604757331c11a84f94d3a75aa13f64637dd16a4ea5e01035ef (4e2c56be38f961c4e586b358792ba9d19d6c4c93)
- d93fd1d6568557bcf214bde8954536b91e15aa161c91d1992a5546b5c0b89ea1 (c94a971dae9a26cb269697135231ea67cafb4eb8)
- 6a6cf1addcdd1bcaf1b9663d30f1e860a2fb7a9969aacf3a0a04834e7ea49b15 (be3b166fcac9f7ba0c1b6663e628fca28a8ab8f4)
- ba42988b07a95f9f86eca1ba2b57e16280a7c9467ea8675eeb3e44b19a81686c (9c9cbc0dec182a3b797ae97708c13e723e8acec7)
- 28e5171be2ca76c23e8ce80d2d19cb0316140d0aaa7dd162a646583075ff387f (663f73398a7bb14aef8389d0d6bb28197cdf37db)
- d2cb561fc9220af93df85b52ba9f381fdf178833da46379075549c105a9f317c (82083fe31c3fdddaaf840144a177bbdc9ec688a2)
- c7463fa4971c3fedc803cbfe3ed8207e7aabd2274d9f941d4c30f049b3d60c66 (f8167152e4ad4586e1492a35a8d7d9ed537c76a7)
- 02e8d7d5451d4793751595a15002ed540d2020ec91d0b99ef80da4e54455191e (a0cdc9db03c38167cb2ff50688d000c746d1f139)
- 22ec4013073b1100d87ecab1ab9a22eea2f16bdf4706759bc7691ff2034cfad6 (38c9c54d9d9643c3661b472b7146a73d25346df1)
- 262301e2e8a1beca3a6bce8351544cde20c25882dacea59960667546e5b30585 (f31c9bc281aca35065bfd24789dc554f6f06a97d)
- 7089eca2ce2cc83175c2bd49c4a3422e107748bec4b17a2fff62135a90817a4d (08b6bbff1026930817633d6a9009002abcc9668d)
- 41e8836df250a6380a2d9494ad82aa921f577491c12adf8824d49a93c5f008af (e5fa9f299513a4f2e4f65c4dd92c27a6907102d4)

.gitattributes CHANGED
@@ -33,3 +33,16 @@ 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
+ gemma-1.1-2b-it.IQ3_XS.gguf filter=lfs diff=lfs merge=lfs -text
37
+ gemma-1.1-2b-it.IQ4_XS.gguf filter=lfs diff=lfs merge=lfs -text
38
+ gemma-1.1-2b-it.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
39
+ gemma-1.1-2b-it.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
40
+ gemma-1.1-2b-it.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ gemma-1.1-2b-it.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
42
+ gemma-1.1-2b-it.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
43
+ gemma-1.1-2b-it.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
44
+ gemma-1.1-2b-it.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
45
+ gemma-1.1-2b-it.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
46
+ gemma-1.1-2b-it.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
47
+ gemma-1.1-2b-it.fp16.gguf filter=lfs diff=lfs merge=lfs -text
48
+ gemma-1.1-2b-it.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - quantized
4
+ - 2-bit
5
+ - 3-bit
6
+ - 4-bit
7
+ - 5-bit
8
+ - 6-bit
9
+ - 8-bit
10
+ - GGUF
11
+ - transformers
12
+ - safetensors
13
+ - gemma
14
+ - text-generation
15
+ - conversational
16
+ - arxiv:2312.11805
17
+ - arxiv:2009.03300
18
+ - arxiv:1905.07830
19
+ - arxiv:1911.11641
20
+ - arxiv:1904.09728
21
+ - arxiv:1905.10044
22
+ - arxiv:1907.10641
23
+ - arxiv:1811.00937
24
+ - arxiv:1809.02789
25
+ - arxiv:1911.01547
26
+ - arxiv:1705.03551
27
+ - arxiv:2107.03374
28
+ - arxiv:2108.07732
29
+ - arxiv:2110.14168
30
+ - arxiv:2304.06364
31
+ - arxiv:2206.04615
32
+ - arxiv:1804.06876
33
+ - arxiv:2110.08193
34
+ - license:gemma
35
+ - autotrain_compatible
36
+ - endpoints_compatible
37
+ - has_space
38
+ - text-generation-inference
39
+ - region:us
40
+ - text-generation
41
+ model_name: gemma-1.1-2b-it-GGUF
42
+ base_model: google/gemma-1.1-2b-it
43
+ inference: false
44
+ model_creator: google
45
+ pipeline_tag: text-generation
46
+ quantized_by: MaziyarPanahi
47
+ ---
48
+ # [MaziyarPanahi/gemma-1.1-2b-it-GGUF](https://huggingface.co/MaziyarPanahi/gemma-1.1-2b-it-GGUF)
49
+ - Model creator: [google](https://huggingface.co/google)
50
+ - Original model: [google/gemma-1.1-2b-it](https://huggingface.co/google/gemma-1.1-2b-it)
51
+
52
+ ## Description
53
+ [MaziyarPanahi/gemma-1.1-2b-it-GGUF](https://huggingface.co/MaziyarPanahi/gemma-1.1-2b-it-GGUF) contains GGUF format model files for [google/gemma-1.1-2b-it](https://huggingface.co/google/gemma-1.1-2b-it).
54
+
55
+ ## How to use
56
+ Thanks to [TheBloke](https://huggingface.co/TheBloke) for preparing an amazing README on how to use GGUF models:
57
+
58
+ ### About GGUF
59
+
60
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
61
+
62
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
63
+
64
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
65
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
66
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
67
+ * [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
68
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration. Linux available, in beta as of 27/11/2023.
69
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
70
+ * [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
71
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
72
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
73
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server. Note, as of time of writing (November 27th 2023), ctransformers has not been updated in a long time and does not support many recent models.
74
+
75
+ ### Explanation of quantisation methods
76
+
77
+ <details>
78
+ <summary>Click to see details</summary>
79
+
80
+ The new methods available are:
81
+
82
+ * 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)
83
+ * 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.
84
+ * 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.
85
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
86
+ * 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
87
+
88
+ ## How to download GGUF files
89
+
90
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
91
+
92
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
93
+
94
+ * LM Studio
95
+ * LoLLMS Web UI
96
+ * Faraday.dev
97
+
98
+ ### In `text-generation-webui`
99
+
100
+ Under Download Model, you can enter the model repo: [MaziyarPanahi/gemma-1.1-2b-it-GGUF](https://huggingface.co/MaziyarPanahi/gemma-1.1-2b-it-GGUF) and below it, a specific filename to download, such as: gemma-1.1-2b-it-GGUF.Q4_K_M.gguf.
101
+
102
+ Then click Download.
103
+
104
+ ### On the command line, including multiple files at once
105
+
106
+ I recommend using the `huggingface-hub` Python library:
107
+
108
+ ```shell
109
+ pip3 install huggingface-hub
110
+ ```
111
+
112
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
113
+
114
+ ```shell
115
+ huggingface-cli download MaziyarPanahi/gemma-1.1-2b-it-GGUF gemma-1.1-2b-it.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
116
+ ```
117
+ </details>
118
+ <details>
119
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
120
+
121
+ You can also download multiple files at once with a pattern:
122
+
123
+ ```shell
124
+ huggingface-cli download [MaziyarPanahi/gemma-1.1-2b-it-GGUF](https://huggingface.co/MaziyarPanahi/gemma-1.1-2b-it-GGUF) --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
125
+ ```
126
+
127
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
128
+
129
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
130
+
131
+ ```shell
132
+ pip3 install hf_transfer
133
+ ```
134
+
135
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
136
+
137
+ ```shell
138
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download MaziyarPanahi/gemma-1.1-2b-it-GGUF gemma-1.1-2b-it.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
139
+ ```
140
+
141
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
142
+ </details>
143
+
144
+ ## Example `llama.cpp` command
145
+
146
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
147
+
148
+ ```shell
149
+ ./main -ngl 35 -m gemma-1.1-2b-it.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system
150
+ {system_message}<|im_end|>
151
+ <|im_start|>user
152
+ {prompt}<|im_end|>
153
+ <|im_start|>assistant"
154
+ ```
155
+
156
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
157
+
158
+ Change `-c 32768` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
159
+
160
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
161
+
162
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
163
+
164
+ ## How to run in `text-generation-webui`
165
+
166
+ Further instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20-%20Model%20Tab.md#llamacpp).
167
+
168
+ ## How to run from Python code
169
+
170
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
171
+
172
+ ### How to load this model in Python code, using llama-cpp-python
173
+
174
+ For full documentation, please see: [llama-cpp-python docs](https://github.com/abetlen/llama-cpp-python/).
175
+
176
+ #### First install the package
177
+
178
+ Run one of the following commands, according to your system:
179
+
180
+ ```shell
181
+ # Base ctransformers with no GPU acceleration
182
+ pip install llama-cpp-python
183
+ # With NVidia CUDA acceleration
184
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
185
+ # Or with OpenBLAS acceleration
186
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
187
+ # Or with CLBLast acceleration
188
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
189
+ # Or with AMD ROCm GPU acceleration (Linux only)
190
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
191
+ # Or with Metal GPU acceleration for macOS systems only
192
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
193
+
194
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
195
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
196
+ pip install llama-cpp-python
197
+ ```
198
+
199
+ #### Simple llama-cpp-python example code
200
+
201
+ ```python
202
+ from llama_cpp import Llama
203
+
204
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
205
+ llm = Llama(
206
+ model_path="./gemma-1.1-2b-it.Q4_K_M.gguf", # Download the model file first
207
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
208
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
209
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
210
+ )
211
+
212
+ # Simple inference example
213
+ output = llm(
214
+ "<|im_start|>system
215
+ {system_message}<|im_end|>
216
+ <|im_start|>user
217
+ {prompt}<|im_end|>
218
+ <|im_start|>assistant", # Prompt
219
+ max_tokens=512, # Generate up to 512 tokens
220
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
221
+ echo=True # Whether to echo the prompt
222
+ )
223
+
224
+ # Chat Completion API
225
+
226
+ llm = Llama(model_path="./gemma-1.1-2b-it.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
227
+ llm.create_chat_completion(
228
+ messages = [
229
+ {"role": "system", "content": "You are a story writing assistant."},
230
+ {
231
+ "role": "user",
232
+ "content": "Write a story about llamas."
233
+ }
234
+ ]
235
+ )
236
+ ```
237
+
238
+ ## How to use with LangChain
239
+
240
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
241
+
242
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
243
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
gemma-1.1-2b-it.IQ3_XS.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27ae8abe82ce3d42a941c5748b9ad2f268e7dd4b4fc84059d730959d1cc49c0e
3
+ size 1244358400
gemma-1.1-2b-it.IQ4_XS.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fe41c0c022ba5992f06b50421680c1daccdf387262372c206fdc7fc99299450
3
+ size 1501218560
gemma-1.1-2b-it.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:621eb054831bd9ee34bb45fd18d4148ad05d4c95222f697f2394b8ab36d384a5
3
+ size 1157924608
gemma-1.1-2b-it.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc243133f5a1112c2ee88af28c5dade536d1d7e6f5e4c718daefab8384a04bf8
3
+ size 1465591552
gemma-1.1-2b-it.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d05e5355f4b1e6c0e84371124f481d595c0a9a9ca6551a04808f0f02a5cba80d
3
+ size 1383802624
gemma-1.1-2b-it.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e89fb9bcd2cd42166fbf76ef16aa5cae08c6773b6eda86ee008b20c54473620
3
+ size 1287980800
gemma-1.1-2b-it.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3b0c819412a3ffa1e899a46190923113904e244b7ee68dfca7a48ef787ce99e
3
+ size 1630263040
gemma-1.1-2b-it.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:834f9a43aa66404935cb9df03620a9412ea5d8f6b3c75de973c648c6e444c53d
3
+ size 1559840512
gemma-1.1-2b-it.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91cbfe27e3c16ff2f72ca1bb7b972fb0dd43b09c898e256390fa699f50ce8f80
3
+ size 1839650560
gemma-1.1-2b-it.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6993bd95973ab80637b7383e9ed272a9693ff28f9d82a6ee360ef3740cd27a6c
3
+ size 1798915840
gemma-1.1-2b-it.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbe584f993a6126fa8f3ff8db69202d5e54ce000c71bc2877aae56134f7f5694
3
+ size 2062124800
gemma-1.1-2b-it.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ded025271b2e6a382c76b1f07eba6a315f00a8c9a26952631d580536487486a
3
+ size 2669070080
gemma-1.1-2b-it.fp16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffbc46a2fce527983f11c47939e1d708bdca2fdb67fac8a18991b61e110c8133
3
+ size 5018535616