andrijdavid commited on
Commit
75cbabb
1 Parent(s): f526d51

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +284 -0
README.md ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ---
4
+ language:
5
+ - zh
6
+ - en
7
+ - fr
8
+ - de
9
+ - ja
10
+ - ko
11
+ - it
12
+ - fi
13
+ license: other
14
+ tags:
15
+ - llama-3
16
+ - GGUF
17
+ pipeline_tag: text-generation
18
+ license_name: llama3
19
+ license_link: https://llama.meta.com/llama3/license/
20
+ quantized_by: andrijdavid
21
+ ---
22
+ # openbuddy-llama3-8b-v21.1-8k-GGUF
23
+ - Original model: [openbuddy-llama3-8b-v21.1-8k](https://huggingface.co/OpenBuddy/openbuddy-llama3-8b-v21.1-8k)
24
+
25
+ <!-- description start -->
26
+ ## Description
27
+
28
+ This repo contains GGUF format model files for [openbuddy-llama3-8b-v21.1-8k](https://huggingface.co/OpenBuddy/openbuddy-llama3-8b-v21.1-8k).
29
+
30
+ <!-- description end -->
31
+ <!-- README_GGUF.md-about-gguf start -->
32
+ ### About GGUF
33
+ 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.
34
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
35
+ * [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.
36
+ * [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.
37
+ * [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​
38
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
39
+ * [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
40
+ * [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
41
+ * [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.
42
+ * [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.
43
+ * [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.
44
+ * [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
45
+ * [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
46
+ * [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
47
+ <!-- README_GGUF.md-about-gguf end -->
48
+
49
+ <!-- compatibility_gguf start -->
50
+ ## Explanation of quantisation methods
51
+ <details>
52
+ <summary>Click to see details</summary>
53
+ The new methods available are:
54
+
55
+ * 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)
56
+ * 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.
57
+ * 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.
58
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
59
+ * 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.
60
+ </details>
61
+ <!-- compatibility_gguf end -->
62
+
63
+ <!-- README_GGUF.md-how-to-download start -->
64
+ ## How to download GGUF files
65
+
66
+ **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.
67
+
68
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
69
+
70
+ * LM Studio
71
+ * LoLLMS Web UI
72
+ * Faraday.dev
73
+
74
+ ### In `text-generation-webui`
75
+
76
+ Under Download Model, you can enter the model repo: LiteLLMs/openbuddy-llama3-8b-v21.1-8k-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00009.gguf.
77
+
78
+ Then click Download.
79
+
80
+ ### On the command line, including multiple files at once
81
+
82
+ I recommend using the `huggingface-hub` Python library:
83
+
84
+ ```shell
85
+ pip3 install huggingface-hub
86
+ ```
87
+
88
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
89
+
90
+ ```shell
91
+ huggingface-cli download LiteLLMs/openbuddy-llama3-8b-v21.1-8k-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
92
+ ```
93
+
94
+ <details>
95
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
96
+
97
+ You can also download multiple files at once with a pattern:
98
+
99
+ ```shell
100
+ huggingface-cli download LiteLLMs/openbuddy-llama3-8b-v21.1-8k-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
101
+ ```
102
+
103
+ 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).
104
+
105
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
106
+
107
+ ```shell
108
+ pip3 install huggingface_hub[hf_transfer]
109
+ ```
110
+
111
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
112
+
113
+ ```shell
114
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/openbuddy-llama3-8b-v21.1-8k-GGUF Q4_0/Q4_0-00001-of-00009.gguf --local-dir . --local-dir-use-symlinks False
115
+ ```
116
+
117
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
118
+ </details>
119
+ <!-- README_GGUF.md-how-to-download end -->
120
+ <!-- README_GGUF.md-how-to-run start -->
121
+ ## Example `llama.cpp` command
122
+
123
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
124
+
125
+ ```shell
126
+ ./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>"
127
+ ```
128
+
129
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
130
+
131
+ 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.
132
+
133
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
134
+
135
+ 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)
136
+
137
+ ## How to run in `text-generation-webui`
138
+
139
+ 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).
140
+
141
+ ## How to run from Python code
142
+
143
+ 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.
144
+
145
+ ### How to load this model in Python code, using llama-cpp-python
146
+
147
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
148
+
149
+ #### First install the package
150
+
151
+ Run one of the following commands, according to your system:
152
+
153
+ ```shell
154
+ # Base ctransformers with no GPU acceleration
155
+ pip install llama-cpp-python
156
+ # With NVidia CUDA acceleration
157
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
158
+ # Or with OpenBLAS acceleration
159
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
160
+ # Or with CLBLast acceleration
161
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
162
+ # Or with AMD ROCm GPU acceleration (Linux only)
163
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
164
+ # Or with Metal GPU acceleration for macOS systems only
165
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
166
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
167
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
168
+ pip install llama-cpp-python
169
+ ```
170
+
171
+ #### Simple llama-cpp-python example code
172
+
173
+ ```python
174
+ from llama_cpp import Llama
175
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
176
+ llm = Llama(
177
+ model_path="./Q4_0/Q4_0-00001-of-00009.gguf", # Download the model file first
178
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
179
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
180
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
181
+ )
182
+ # Simple inference example
183
+ output = llm(
184
+ "<PROMPT>", # Prompt
185
+ max_tokens=512, # Generate up to 512 tokens
186
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
187
+ echo=True # Whether to echo the prompt
188
+ )
189
+ # Chat Completion API
190
+ 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
191
+ llm.create_chat_completion(
192
+ messages = [
193
+ {"role": "system", "content": "You are a story writing assistant."},
194
+ {
195
+ "role": "user",
196
+ "content": "Write a story about llamas."
197
+ }
198
+ ]
199
+ )
200
+ ```
201
+
202
+ ## How to use with LangChain
203
+
204
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
205
+
206
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
207
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
208
+
209
+ <!-- README_GGUF.md-how-to-run end -->
210
+
211
+ <!-- footer end -->
212
+
213
+ <!-- original-model-card start -->
214
+ # Original model card: openbuddy-llama3-8b-v21.1-8k
215
+
216
+
217
+
218
+ # OpenBuddy - Open Multilingual Chatbot
219
+
220
+
221
+ GitHub and Usage Guide: [https://github.com/OpenBuddy/OpenBuddy](https://github.com/OpenBuddy/OpenBuddy)
222
+
223
+ Website and Demo: [https://openbuddy.ai](https://openbuddy.ai)
224
+
225
+ Evaluation result of this model: [Evaluation.txt](Evaluation.txt)
226
+
227
+ ![Demo](https://raw.githubusercontent.com/OpenBuddy/OpenBuddy/main/media/demo.png)
228
+
229
+
230
+ # Run locally with 🦙Ollama
231
+
232
+ ```
233
+ ollama run openbuddy/openbuddy-llama3-8b-v21.1-8k
234
+ ```
235
+
236
+ # Copyright Notice
237
+
238
+ **Built with Meta Llama 3**
239
+
240
+ License: https://llama.meta.com/llama3/license/
241
+
242
+ Acceptable Use Policy: https://llama.meta.com/llama3/use-policy
243
+
244
+ This model is intended for use in English and Chinese.
245
+
246
+
247
+ # Prompt Format
248
+
249
+ We recommend using the fast tokenizer from `transformers`, which should be enabled by default in the `transformers` and `vllm` libraries. Other implementations including `sentencepiece` may not work as expected, especially for special tokens like `<|role|>`, `<|says|>` and `<|end|>`.
250
+
251
+ ```
252
+ <|role|>system<|says|>You(assistant) are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human(user).
253
+ Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
254
+ You cannot access the internet, but you have vast knowledge, cutoff: 2023-04.
255
+ You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), not related to GPT or OpenAI.<|end|>
256
+ <|role|>user<|says|>History input 1<|end|>
257
+ <|role|>assistant<|says|>History output 1<|end|>
258
+ <|role|>user<|says|>History input 2<|end|>
259
+ <|role|>assistant<|says|>History output 2<|end|>
260
+ <|role|>user<|says|>Current input<|end|>
261
+ <|role|>assistant<|says|>
262
+ ```
263
+
264
+
265
+ This format is also defined in `tokenizer_config.json`, which means you can directly use `vllm` to deploy an OpenAI-like API service. For more information, please refer to the [vllm documentation](https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html).
266
+
267
+ ## Disclaimer
268
+
269
+ All OpenBuddy models have inherent limitations and may potentially produce outputs that are erroneous, harmful, offensive, or otherwise undesirable. Users should not use these models in critical or high-stakes situations that may lead to personal injury, property damage, or significant losses. Examples of such scenarios include, but are not limited to, the medical field, controlling software and hardware systems that may cause harm, and making important financial or legal decisions.
270
+
271
+ OpenBuddy is provided "as-is" without any warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors, contributors, or copyright holders be liable for any claim, damages, or other liabilities, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
272
+
273
+ By using OpenBuddy, you agree to these terms and conditions, and acknowledge that you understand the potential risks associated with its use. You also agree to indemnify and hold harmless the authors, contributors, and copyright holders from any claims, damages, or liabilities arising from your use of OpenBuddy.
274
+
275
+
276
+ ## 免责声明
277
+
278
+ 所有OpenBuddy模型均存在固有的局限性,可能产生错误的、有害的、冒犯性的或其他不良的输出。用户在关键或高风险场景中应谨慎行事,不要使用这些模型,以免导致人身伤害、财产损失或重大损失。此类场景的例子包括但不限于医疗领域、可能导致伤害的软硬件系统的控制以及进行重要的财务或法律决策。
279
+
280
+ OpenBuddy按“原样”提供,不附带任何种类的明示或暗示的保证,包括但不限于适销性、特定目的的适用性和非侵权的暗示保证。在任何情况下,作者、贡献者或版权所有者均不对因软件或使用或其他软件交易而产生的任何索赔、损害赔偿或其他责任(无论是合同、侵权还是其他原因)承担责任。
281
+
282
+ 使用OpenBuddy即表示您同意这些条款和条件,并承认您了解其使用可能带来的潜在风险。您还同意赔偿并使作者、贡献者和版权所有者免受因您使用OpenBuddy而产生的任何索赔、损害赔偿或责任的影响。
283
+
284
+ <!-- original-model-card end -->