MaziyarPanahi commited on
Commit
1722360
1 Parent(s): 768c6bc

Upload folder using huggingface_hub (#1)

Browse files

- 9665c8b2f65143c131474ee6b741ea94c8603979d3983725f1e56bca3825c360 (ac32c57d3812805a03aca145111b57e8886d58f6)
- b9ad748875ab6ea7ccb6eda2ecc5079bb4016d926e861ddaba9921cd5e672768 (aa6fc20345c9341c9717f10e041d82ce813f378e)
- 445fcea1980a6108f3215a534239fcc0879a061d0ace8f480c92d0bcc2a2f142 (6f5bfac303fe035225d4c79f18ff1f3ca79364b1)
- eb315fd5004e49aa4f8be159b8a4f4621133b04c67304c02c0b7b5586cd501ea (c5ca2bbe809b3c3ae90fd6eb83e9cbe71ce270dc)
- 7a9fea5e7a06e155d6960b138cac95066e274e86e9fcaff360f33ab30a7590e5 (2f29c668f2e03c170b9238019b50bb8bd32deee6)
- 8b842aea005a124738ad22f1643e08bff9191f884745bb9582cc505f24e60959 (01fe1660658db5daa41a48fa555b426beb8e2d9c)
- 39710a583ab21ca171f339167555d116dd2d0a222491713ec0689651670dc241 (15d18eba07c796251696d4b17dced808646c56cc)
- f6ce5a55b5fc63dfa54ed0ffb1bc60a107eaef4a514146ca42eb6106dafdeeef (df2d68fa3037233b232919405c23ed123a68d9d5)
- 5bdffae98e864cbf4c3ef8fa435e05eae9aedd21644137cabbf639d9f5ac45f9 (e8fe801e4d89ee2133acddd80cdd287a77e87423)
- 61eee3694792852f65fe8ffc04177c913d456125823e04903c56695a887a5f2a (984e2b204ad534608fa6639b57c00af8aa2de62a)
- 23e22926ef3d4a6bb7cc5982d6a5ceca88c2294635a9c8c745562ba59e16a9cd (39efdc11117509930613a667c416244083f2fc4b)

.gitattributes CHANGED
@@ -33,3 +33,13 @@ 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
+ LongAlpaca-13B-16k.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
37
+ LongAlpaca-13B-16k.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
38
+ LongAlpaca-13B-16k.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
39
+ LongAlpaca-13B-16k.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
40
+ LongAlpaca-13B-16k.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ LongAlpaca-13B-16k.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
42
+ LongAlpaca-13B-16k.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
43
+ LongAlpaca-13B-16k.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
44
+ LongAlpaca-13B-16k.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
45
+ LongAlpaca-13B-16k.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
LongAlpaca-13B-16k.Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8684e6d1428ea420f9b1ba79fb7514076a207086265ef40e4d7850076c581c0e
3
+ size 4854275904
LongAlpaca-13B-16k.Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:478edc961032d4d7834be219c3b858bec48df639a76ee1dfad6c5469d4ac22d4
3
+ size 6929566016
LongAlpaca-13B-16k.Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd52090981bfc859bc49d284e1d5d07649013b7e75ba53ccc15e8ee4e8c5ae4c
3
+ size 6337775936
LongAlpaca-13B-16k.Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ee5684b9709d753d08a835d556f7fd2d2140e5836f3107ec34ccc9f8a851059
3
+ size 5658986816
LongAlpaca-13B-16k.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db1105c5ad0c4ca64b55d1a2c547c5d142f9e20caeb1805ae6f47c65701c7fe3
3
+ size 7865963488
LongAlpaca-13B-16k.Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f9a0ee3577c80a78b135357e137271d18a2f761b629e3ac8c94b84f0314d8a2
3
+ size 7423185888
LongAlpaca-13B-16k.Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ded85e0d2c3cae6743b80ec28250babd8224b1efba9ae8c66602f446e1d159e4
3
+ size 9229932128
LongAlpaca-13B-16k.Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0eb156f8958b7977b6b9b39373001a316eb718a30b900ed31e7f07fe7ba5db7d
3
+ size 8972293728
LongAlpaca-13B-16k.Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc806f9f02285f59c1a1b5c0e8af139e85d79035e438da65108999c4daa620a4
3
+ size 10679148832
LongAlpaca-13B-16k.Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8a6c113775dc8a8791c23090744f1bd6de7498160d6112d1cb7577adc7a2a0f
3
+ size 13831330464
README.md ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - pytorch
13
+ - llama
14
+ - text-generation
15
+ - autotrain_compatible
16
+ - endpoints_compatible
17
+ - text-generation-inference
18
+ - region:us
19
+ - text-generation
20
+ model_name: LongAlpaca-13B-16k-GGUF
21
+ base_model: Yukang/LongAlpaca-13B-16k
22
+ inference: false
23
+ model_creator: Yukang
24
+ pipeline_tag: text-generation
25
+ quantized_by: MaziyarPanahi
26
+ ---
27
+ # [MaziyarPanahi/LongAlpaca-13B-16k-GGUF](https://huggingface.co/MaziyarPanahi/LongAlpaca-13B-16k-GGUF)
28
+ - Model creator: [Yukang](https://huggingface.co/Yukang)
29
+ - Original model: [Yukang/LongAlpaca-13B-16k](https://huggingface.co/Yukang/LongAlpaca-13B-16k)
30
+
31
+ ## Description
32
+ [MaziyarPanahi/LongAlpaca-13B-16k-GGUF](https://huggingface.co/MaziyarPanahi/LongAlpaca-13B-16k-GGUF) contains GGUF format model files for [Yukang/LongAlpaca-13B-16k](https://huggingface.co/Yukang/LongAlpaca-13B-16k).
33
+
34
+ ## How to use
35
+ Thanks to [TheBloke](https://huggingface.co/TheBloke) for preparing an amazing README on how to use GGUF models:
36
+
37
+ ### About GGUF
38
+
39
+ 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.
40
+
41
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
42
+
43
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
44
+ * [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.
45
+ * [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.
46
+ * [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.
47
+ * [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.
48
+ * [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.
49
+ * [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.
50
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
51
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
52
+ * [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.
53
+
54
+ ### Explanation of quantisation methods
55
+
56
+ <details>
57
+ <summary>Click to see details</summary>
58
+
59
+ The new methods available are:
60
+
61
+ * 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)
62
+ * 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.
63
+ * 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.
64
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
65
+ * 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
66
+
67
+ ## How to download GGUF files
68
+
69
+ **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.
70
+
71
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
72
+
73
+ * LM Studio
74
+ * LoLLMS Web UI
75
+ * Faraday.dev
76
+
77
+ ### In `text-generation-webui`
78
+
79
+ Under Download Model, you can enter the model repo: [MaziyarPanahi/LongAlpaca-13B-16k-GGUF](https://huggingface.co/MaziyarPanahi/LongAlpaca-13B-16k-GGUF) and below it, a specific filename to download, such as: LongAlpaca-13B-16k-GGUF.Q4_K_M.gguf.
80
+
81
+ Then click Download.
82
+
83
+ ### On the command line, including multiple files at once
84
+
85
+ I recommend using the `huggingface-hub` Python library:
86
+
87
+ ```shell
88
+ pip3 install huggingface-hub
89
+ ```
90
+
91
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
92
+
93
+ ```shell
94
+ huggingface-cli download MaziyarPanahi/LongAlpaca-13B-16k-GGUF LongAlpaca-13B-16k-GGUF.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
95
+ ```
96
+ </details>
97
+ <details>
98
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
99
+
100
+ You can also download multiple files at once with a pattern:
101
+
102
+ ```shell
103
+ huggingface-cli download [MaziyarPanahi/LongAlpaca-13B-16k-GGUF](https://huggingface.co/MaziyarPanahi/LongAlpaca-13B-16k-GGUF) --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
104
+ ```
105
+
106
+ 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).
107
+
108
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
109
+
110
+ ```shell
111
+ pip3 install hf_transfer
112
+ ```
113
+
114
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
115
+
116
+ ```shell
117
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download MaziyarPanahi/LongAlpaca-13B-16k-GGUF LongAlpaca-13B-16k-GGUF.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
118
+ ```
119
+
120
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
121
+ </details>
122
+
123
+ ## Example `llama.cpp` command
124
+
125
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
126
+
127
+ ```shell
128
+ ./main -ngl 35 -m LongAlpaca-13B-16k-GGUF.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system
129
+ {system_message}<|im_end|>
130
+ <|im_start|>user
131
+ {prompt}<|im_end|>
132
+ <|im_start|>assistant"
133
+ ```
134
+
135
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
136
+
137
+ 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.
138
+
139
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
140
+
141
+ 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)
142
+
143
+ ## How to run in `text-generation-webui`
144
+
145
+ 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%E2%80%90%20Model%20Tab.md#llamacpp).
146
+
147
+ ## How to run from Python code
148
+
149
+ 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.
150
+
151
+ ### How to load this model in Python code, using llama-cpp-python
152
+
153
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
154
+
155
+ #### First install the package
156
+
157
+ Run one of the following commands, according to your system:
158
+
159
+ ```shell
160
+ # Base ctransformers with no GPU acceleration
161
+ pip install llama-cpp-python
162
+ # With NVidia CUDA acceleration
163
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
164
+ # Or with OpenBLAS acceleration
165
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
166
+ # Or with CLBLast acceleration
167
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
168
+ # Or with AMD ROCm GPU acceleration (Linux only)
169
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
170
+ # Or with Metal GPU acceleration for macOS systems only
171
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
172
+
173
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
174
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
175
+ pip install llama-cpp-python
176
+ ```
177
+
178
+ #### Simple llama-cpp-python example code
179
+
180
+ ```python
181
+ from llama_cpp import Llama
182
+
183
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
184
+ llm = Llama(
185
+ model_path="./LongAlpaca-13B-16k-GGUF.Q4_K_M.gguf", # Download the model file first
186
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
187
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
188
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
189
+ )
190
+
191
+ # Simple inference example
192
+ output = llm(
193
+ "<|im_start|>system
194
+ {system_message}<|im_end|>
195
+ <|im_start|>user
196
+ {prompt}<|im_end|>
197
+ <|im_start|>assistant", # Prompt
198
+ max_tokens=512, # Generate up to 512 tokens
199
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
200
+ echo=True # Whether to echo the prompt
201
+ )
202
+
203
+ # Chat Completion API
204
+
205
+ llm = Llama(model_path="./LongAlpaca-13B-16k-GGUF.Q4_K_M.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
206
+ llm.create_chat_completion(
207
+ messages = [
208
+ {"role": "system", "content": "You are a story writing assistant."},
209
+ {
210
+ "role": "user",
211
+ "content": "Write a story about llamas."
212
+ }
213
+ ]
214
+ )
215
+ ```
216
+
217
+ ## How to use with LangChain
218
+
219
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
220
+
221
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
222
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)