andrijdavid commited on
Commit
4dcbf4f
·
verified ·
1 Parent(s): fa0118e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +255 -0
README.md ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ---
4
+ license: llama2
5
+ library_name: transformers
6
+ tags:
7
+ - GGUF
8
+ datasets:
9
+ - aqua_rat
10
+ - microsoft/orca-math-word-problems-200k
11
+ - m-a-p/CodeFeedback-Filtered-Instruction
12
+ - anon8231489123/ShareGPT_Vicuna_unfiltered
13
+ quantized_by: andrijdavid
14
+ ---
15
+ # Llama-3-Smaug-8B-GGUF
16
+ - Original model: [Llama-3-Smaug-8B](https://huggingface.co/abacusai/Llama-3-Smaug-8B)
17
+
18
+ <!-- description start -->
19
+ ## Description
20
+
21
+ This repo contains GGUF format model files for [Llama-3-Smaug-8B](https://huggingface.co/abacusai/Llama-3-Smaug-8B).
22
+
23
+ <!-- description end -->
24
+ <!-- README_GGUF.md-about-gguf start -->
25
+ ### About GGUF
26
+ 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.
27
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
28
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). This is the source project for GGUF, providing both a Command Line Interface (CLI) and a server option.
29
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), Known as the most widely used web UI, this project boasts numerous features and powerful extensions, and supports GPU acceleration.
30
+ * [Ollama](https://github.com/jmorganca/ollama) Ollama is a lightweight and extensible framework designed for building and running language models locally. It features a simple API for creating, managing, and executing models, along with a library of pre-built models for use in various applications​
31
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
32
+ * [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
33
+ * [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
34
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui). A notable web UI with a variety of unique features, including a comprehensive model library for easy model selection.
35
+ * [Faraday.dev](https://faraday.dev/), An attractive, user-friendly character-based chat GUI for Windows and macOS (both Silicon and Intel), also offering GPU acceleration.
36
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), A Python library equipped with GPU acceleration, LangChain support, and an OpenAI-compatible API server.
37
+ * [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
38
+ * [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
39
+ * [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
40
+ <!-- README_GGUF.md-about-gguf end -->
41
+
42
+ <!-- compatibility_gguf start -->
43
+ ## Explanation of quantisation methods
44
+ <details>
45
+ <summary>Click to see details</summary>
46
+ The new methods available are:
47
+
48
+ * 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)
49
+ * 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.
50
+ * 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.
51
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
52
+ * 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.
53
+ </details>
54
+ <!-- compatibility_gguf end -->
55
+
56
+ <!-- README_GGUF.md-how-to-download start -->
57
+ ## How to download GGUF files
58
+
59
+ **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 folder.
60
+
61
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
62
+
63
+ * LM Studio
64
+ * LoLLMS Web UI
65
+ * Faraday.dev
66
+
67
+ ### In `text-generation-webui`
68
+
69
+ Under Download Model, you can enter the model repo: LiteLLMs/Llama-3-Smaug-8B-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00009.gguf.
70
+
71
+ Then click Download.
72
+
73
+ ### On the command line, including multiple files at once
74
+
75
+ I recommend using the `huggingface-hub` Python library:
76
+
77
+ ```shell
78
+ pip3 install huggingface-hub
79
+ ```
80
+
81
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
82
+
83
+ ```shell
84
+ huggingface-cli download LiteLLMs/Llama-3-Smaug-8B-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
85
+ ```
86
+
87
+ <details>
88
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
89
+
90
+ You can also download multiple files at once with a pattern:
91
+
92
+ ```shell
93
+ huggingface-cli download LiteLLMs/Llama-3-Smaug-8B-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
94
+ ```
95
+
96
+ 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).
97
+
98
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
99
+
100
+ ```shell
101
+ pip3 install huggingface_hub[hf_transfer]
102
+ ```
103
+
104
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
105
+
106
+ ```shell
107
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/Llama-3-Smaug-8B-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
108
+ ```
109
+
110
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
111
+ </details>
112
+ <!-- README_GGUF.md-how-to-download end -->
113
+ <!-- README_GGUF.md-how-to-run start -->
114
+ ## Example `llama.cpp` command
115
+
116
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
117
+
118
+ ```shell
119
+ ./main -ngl 35 -m Q4_0/Q4_0-00001-of-00009.gguf --color -c 8192 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<PROMPT>"
120
+ ```
121
+
122
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
123
+
124
+ Change `-c 8192` 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.
125
+
126
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
127
+
128
+ 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)
129
+
130
+ ## How to run in `text-generation-webui`
131
+
132
+ 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).
133
+
134
+ ## How to run from Python code
135
+
136
+ 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.
137
+
138
+ ### How to load this model in Python code, using llama-cpp-python
139
+
140
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
141
+
142
+ #### First install the package
143
+
144
+ Run one of the following commands, according to your system:
145
+
146
+ ```shell
147
+ # Base ctransformers with no GPU acceleration
148
+ pip install llama-cpp-python
149
+ # With NVidia CUDA acceleration
150
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
151
+ # Or with OpenBLAS acceleration
152
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
153
+ # Or with CLBLast acceleration
154
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
155
+ # Or with AMD ROCm GPU acceleration (Linux only)
156
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
157
+ # Or with Metal GPU acceleration for macOS systems only
158
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
159
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
160
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
161
+ pip install llama-cpp-python
162
+ ```
163
+
164
+ #### Simple llama-cpp-python example code
165
+
166
+ ```python
167
+ from llama_cpp import Llama
168
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
169
+ llm = Llama(
170
+ model_path="./Q4_0/Q4_0-00001-of-00009.gguf", # Download the model file first
171
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
172
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
173
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
174
+ )
175
+ # Simple inference example
176
+ output = llm(
177
+ "<PROMPT>", # Prompt
178
+ max_tokens=512, # Generate up to 512 tokens
179
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
180
+ echo=True # Whether to echo the prompt
181
+ )
182
+ # Chat Completion API
183
+ llm = Llama(model_path="./Q4_0/Q4_0-00001-of-00009.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
184
+ llm.create_chat_completion(
185
+ messages = [
186
+ {"role": "system", "content": "You are a story writing assistant."},
187
+ {
188
+ "role": "user",
189
+ "content": "Write a story about llamas."
190
+ }
191
+ ]
192
+ )
193
+ ```
194
+
195
+ ## How to use with LangChain
196
+
197
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
198
+
199
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
200
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
201
+
202
+ <!-- README_GGUF.md-how-to-run end -->
203
+
204
+ <!-- footer end -->
205
+
206
+ <!-- original-model-card start -->
207
+ # Original model card: Llama-3-Smaug-8B
208
+
209
+
210
+ # Llama-3-Smaug-8B
211
+
212
+ ### Built with Meta Llama 3
213
+
214
+
215
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64c14f95cac5f9ba52bbcd7f/OrcJyTaUtD2HxJOPPwNva.png)
216
+
217
+ This model was built using the Smaug recipe for improving performance on real world multi-turn conversations applied to
218
+ [meta-llama/Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B).
219
+
220
+ ### Model Description
221
+
222
+ - **Developed by:** [Abacus.AI](https://abacus.ai)
223
+ - **License:** https://llama.meta.com/llama3/license/
224
+ - **Finetuned from model:** [meta-llama/Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B).
225
+
226
+ ## Evaluation
227
+
228
+ ### MT-Bench
229
+
230
+ ```
231
+ ########## First turn ##########
232
+ score
233
+ model turn
234
+ Llama-3-Smaug-8B 1 8.77500
235
+ Meta-Llama-3-8B-Instruct 1 8.1
236
+ ########## Second turn ##########
237
+ score
238
+ model turn
239
+ Meta-Llama-3-8B-Instruct 2 8.2125
240
+ Llama-3-Smaug-8B 2 7.8875
241
+ ########## Average ##########
242
+ score
243
+ model
244
+ Llama-3-Smaug-8B 8.331250
245
+ Meta-Llama-3-8B-Instruct 8.15625
246
+ ```
247
+
248
+ | Model | First turn | Second Turn | Average |
249
+ | - | -: | : |
250
+ | Llama-3-Smaug-8B | 8.78 | 7.89 | 8.33 |
251
+ | Llama-3-8B-Instruct | 8.1 | 8.21 | 8.16 |
252
+
253
+ This version of Smaug uses new techniques and new data compared to [Smaug-72B](https://huggingface.co/abacusai/Smaug-72B-v0.1), and more information will be released later on. For now, see the previous Smaug paper: https://arxiv.org/abs/2402.13228.
254
+
255
+ <!-- original-model-card end -->