TheBloke commited on
Commit
ee827f9
1 Parent(s): 8f6fbcd

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +756 -0
README.md ADDED
@@ -0,0 +1,756 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: 01-ai/Yi-34B-Chat
3
+ inference: false
4
+ license: other
5
+ license_link: LICENSE
6
+ license_name: yi-license
7
+ model_creator: 01-ai
8
+ model_name: Yi 34B Chat
9
+ model_type: yi
10
+ pipeline_tag: text-generation
11
+ prompt_template: '<|im_start|>system
12
+
13
+ {system_message}<|im_end|>
14
+
15
+ <|im_start|>user
16
+
17
+ {prompt}<|im_end|>
18
+
19
+ <|im_start|>assistant
20
+
21
+ '
22
+ quantized_by: TheBloke
23
+ widget:
24
+ - example_title: Yi-34B-Chat
25
+ output:
26
+ text: ' Hello! How can I assist you today?'
27
+ text: hi
28
+ - example_title: Yi-34B
29
+ output:
30
+ text: " an eerie sense that something is just not right\u2026\nBetween the two\
31
+ \ worlds lies The Forgotten Kingdom - home to creatures long since thought extinct\
32
+ \ and ancient magic so strong it defies belief! Only here can you find what\
33
+ \ has been lost for centuries: An Elixir Of Life which will restore youth and\
34
+ \ vitality if only those who seek its power are brave enough to face up against\
35
+ \ all manner of dangers lurking in this mysterious land! But beware; some say\
36
+ \ there may even exist powerful entities beyond our comprehension whose intentions\
37
+ \ towards humanity remain unclear at best ---- they might want nothing more\
38
+ \ than destruction itself rather then anything else from their quest after immortality\
39
+ \ (and maybe someone should tell them about modern medicine)? In any event though\
40
+ \ \u2013 one thing remains true regardless : whether or not success comes easy\
41
+ \ depends entirely upon how much effort we put into conquering whatever challenges\
42
+ \ lie ahead along with having faith deep down inside ourselves too ;) So let\u2019\
43
+ s get started now shall We?"
44
+ text: There's a place where time stands still. A place of breath taking wonder,
45
+ but also
46
+ ---
47
+ <!-- markdownlint-disable MD041 -->
48
+
49
+ <!-- header start -->
50
+ <!-- 200823 -->
51
+ <div style="width: auto; margin-left: auto; margin-right: auto">
52
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
53
+ </div>
54
+ <div style="display: flex; justify-content: space-between; width: 100%;">
55
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
56
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
57
+ </div>
58
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
59
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
60
+ </div>
61
+ </div>
62
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
63
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
64
+ <!-- header end -->
65
+
66
+ # Yi 34B Chat - GGUF
67
+ - Model creator: [01-ai](https://huggingface.co/01-ai)
68
+ - Original model: [Yi 34B Chat](https://huggingface.co/01-ai/Yi-34B-Chat)
69
+
70
+ <!-- description start -->
71
+ ## Description
72
+
73
+ This repo contains GGUF format model files for [01-ai's Yi 34B Chat](https://huggingface.co/01-ai/Yi-34B-Chat).
74
+
75
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
76
+
77
+ <!-- description end -->
78
+ <!-- README_GGUF.md-about-gguf start -->
79
+ ### About GGUF
80
+
81
+ 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.
82
+
83
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
84
+
85
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
86
+ * [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.
87
+ * [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.
88
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration.
89
+ * [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.
90
+ * [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.
91
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
92
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
93
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
94
+
95
+ <!-- README_GGUF.md-about-gguf end -->
96
+ <!-- repositories-available start -->
97
+ ## Repositories available
98
+
99
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Yi-34B-Chat-AWQ)
100
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ)
101
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF)
102
+ * [01-ai's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/01-ai/Yi-34B-Chat)
103
+ <!-- repositories-available end -->
104
+
105
+ <!-- prompt-template start -->
106
+ ## Prompt template: ChatML
107
+
108
+ ```
109
+ <|im_start|>system
110
+ {system_message}<|im_end|>
111
+ <|im_start|>user
112
+ {prompt}<|im_end|>
113
+ <|im_start|>assistant
114
+
115
+ ```
116
+
117
+ <!-- prompt-template end -->
118
+
119
+
120
+ <!-- compatibility_gguf start -->
121
+ ## Compatibility
122
+
123
+ These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
124
+
125
+ They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
126
+
127
+ ## Explanation of quantisation methods
128
+
129
+ <details>
130
+ <summary>Click to see details</summary>
131
+
132
+ The new methods available are:
133
+
134
+ * 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)
135
+ * 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.
136
+ * 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.
137
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
138
+ * 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
139
+
140
+ Refer to the Provided Files table below to see what files use which methods, and how.
141
+ </details>
142
+ <!-- compatibility_gguf end -->
143
+
144
+ <!-- README_GGUF.md-provided-files start -->
145
+ ## Provided files
146
+
147
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
148
+ | ---- | ---- | ---- | ---- | ---- | ----- |
149
+ | [yi-34b-chat.Q2_K.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q2_K.gguf) | Q2_K | 2 | 14.56 GB| 17.06 GB | smallest, significant quality loss - not recommended for most purposes |
150
+ | [yi-34b-chat.Q3_K_S.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q3_K_S.gguf) | Q3_K_S | 3 | 14.96 GB| 17.46 GB | very small, high quality loss |
151
+ | [yi-34b-chat.Q3_K_M.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q3_K_M.gguf) | Q3_K_M | 3 | 16.64 GB| 19.14 GB | very small, high quality loss |
152
+ | [yi-34b-chat.Q3_K_L.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q3_K_L.gguf) | Q3_K_L | 3 | 18.14 GB| 20.64 GB | small, substantial quality loss |
153
+ | [yi-34b-chat.Q4_0.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q4_0.gguf) | Q4_0 | 4 | 19.47 GB| 21.97 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
154
+ | [yi-34b-chat.Q4_K_S.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q4_K_S.gguf) | Q4_K_S | 4 | 19.54 GB| 22.04 GB | small, greater quality loss |
155
+ | [yi-34b-chat.Q4_K_M.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q4_K_M.gguf) | Q4_K_M | 4 | 20.66 GB| 23.16 GB | medium, balanced quality - recommended |
156
+ | [yi-34b-chat.Q5_0.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q5_0.gguf) | Q5_0 | 5 | 23.71 GB| 26.21 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
157
+ | [yi-34b-chat.Q5_K_S.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q5_K_S.gguf) | Q5_K_S | 5 | 23.71 GB| 26.21 GB | large, low quality loss - recommended |
158
+ | [yi-34b-chat.Q5_K_M.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q5_K_M.gguf) | Q5_K_M | 5 | 24.32 GB| 26.82 GB | large, very low quality loss - recommended |
159
+ | [yi-34b-chat.Q6_K.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q6_K.gguf) | Q6_K | 6 | 28.21 GB| 30.71 GB | very large, extremely low quality loss |
160
+ | [yi-34b-chat.Q8_0.gguf](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF/blob/main/yi-34b-chat.Q8_0.gguf) | Q8_0 | 8 | 36.54 GB| 39.04 GB | very large, extremely low quality loss - not recommended |
161
+
162
+ **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
163
+
164
+
165
+
166
+ <!-- README_GGUF.md-provided-files end -->
167
+
168
+ <!-- README_GGUF.md-how-to-download start -->
169
+ ## How to download GGUF files
170
+
171
+ **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.
172
+
173
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
174
+
175
+ * LM Studio
176
+ * LoLLMS Web UI
177
+ * Faraday.dev
178
+
179
+ ### In `text-generation-webui`
180
+
181
+ Under Download Model, you can enter the model repo: TheBloke/Yi-34B-Chat-GGUF and below it, a specific filename to download, such as: yi-34b-chat.Q4_K_M.gguf.
182
+
183
+ Then click Download.
184
+
185
+ ### On the command line, including multiple files at once
186
+
187
+ I recommend using the `huggingface-hub` Python library:
188
+
189
+ ```shell
190
+ pip3 install huggingface-hub
191
+ ```
192
+
193
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
194
+
195
+ ```shell
196
+ huggingface-cli download TheBloke/Yi-34B-Chat-GGUF yi-34b-chat.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
197
+ ```
198
+
199
+ <details>
200
+ <summary>More advanced huggingface-cli download usage</summary>
201
+
202
+ You can also download multiple files at once with a pattern:
203
+
204
+ ```shell
205
+ huggingface-cli download TheBloke/Yi-34B-Chat-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
206
+ ```
207
+
208
+ 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).
209
+
210
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
211
+
212
+ ```shell
213
+ pip3 install hf_transfer
214
+ ```
215
+
216
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
217
+
218
+ ```shell
219
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Yi-34B-Chat-GGUF yi-34b-chat.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
220
+ ```
221
+
222
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
223
+ </details>
224
+ <!-- README_GGUF.md-how-to-download end -->
225
+
226
+ <!-- README_GGUF.md-how-to-run start -->
227
+ ## Example `llama.cpp` command
228
+
229
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
230
+
231
+ ```shell
232
+ ./main -ngl 32 -m yi-34b-chat.Q4_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
233
+ ```
234
+
235
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
236
+
237
+ Change `-c 2048` 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.
238
+
239
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
240
+
241
+ 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)
242
+
243
+ ## How to run in `text-generation-webui`
244
+
245
+ 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).
246
+
247
+ ## How to run from Python code
248
+
249
+ 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.
250
+
251
+ ### How to load this model in Python code, using ctransformers
252
+
253
+ #### First install the package
254
+
255
+ Run one of the following commands, according to your system:
256
+
257
+ ```shell
258
+ # Base ctransformers with no GPU acceleration
259
+ pip install ctransformers
260
+ # Or with CUDA GPU acceleration
261
+ pip install ctransformers[cuda]
262
+ # Or with AMD ROCm GPU acceleration (Linux only)
263
+ CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
264
+ # Or with Metal GPU acceleration for macOS systems only
265
+ CT_METAL=1 pip install ctransformers --no-binary ctransformers
266
+ ```
267
+
268
+ #### Simple ctransformers example code
269
+
270
+ ```python
271
+ from ctransformers import AutoModelForCausalLM
272
+
273
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
274
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/Yi-34B-Chat-GGUF", model_file="yi-34b-chat.Q4_K_M.gguf", model_type="yi", gpu_layers=50)
275
+
276
+ print(llm("AI is going to"))
277
+ ```
278
+
279
+ ## How to use with LangChain
280
+
281
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
282
+
283
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
284
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
285
+
286
+ <!-- README_GGUF.md-how-to-run end -->
287
+
288
+ <!-- footer start -->
289
+ <!-- 200823 -->
290
+ ## Discord
291
+
292
+ For further support, and discussions on these models and AI in general, join us at:
293
+
294
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
295
+
296
+ ## Thanks, and how to contribute
297
+
298
+ Thanks to the [chirper.ai](https://chirper.ai) team!
299
+
300
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
301
+
302
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
303
+
304
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
305
+
306
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
307
+
308
+ * Patreon: https://patreon.com/TheBlokeAI
309
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
310
+
311
+ **Special thanks to**: Aemon Algiz.
312
+
313
+ **Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
314
+
315
+
316
+ Thank you to all my generous patrons and donaters!
317
+
318
+ And thank you again to a16z for their generous grant.
319
+
320
+ <!-- footer end -->
321
+
322
+ <!-- original-model-card start -->
323
+ # Original model card: 01-ai's Yi 34B Chat
324
+
325
+
326
+
327
+ <div align="center">
328
+
329
+ <p align="center">
330
+ <img width="200px" src="https://github.com/01-ai/Yi/raw/main/assets/img/Yi.svg?sanitize=true">
331
+ </p>
332
+
333
+ <div style="display: inline-block;">
334
+ <a rel="noopener nofollow" href="https://github.com/01-ai/Yi/issues">
335
+ <img src="https://img.shields.io/github/issues/01-ai/Yi?logo=github" style="margin: 0 0;">
336
+ </a>
337
+ </div>
338
+
339
+ <div style="display: inline-block;">
340
+ <a rel="noopener nofollow" href="https://github.com/01-ai/Yi/actions/workflows/build_docker_image.yml">
341
+ <img src="https://github.com/01-ai/Yi/actions/workflows/build_docker_image.yml/badge.svg" style="margin: 0 0;">
342
+ </a>
343
+ </div>
344
+
345
+ <div style="display: inline-block;">
346
+ <a href="https://huggingface.co/01-ai">
347
+ <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-01--ai-blue" style="margin: 0 0;">
348
+ </a>
349
+ </div>
350
+
351
+ <div style="display: inline-block;">
352
+ <a rel="noopener nofollow" href="https://www.modelscope.cn/organization/01ai/">
353
+ <img src="https://img.shields.io/badge/ModelScope-01--ai-blue" style="margin: 0 0;">
354
+ </a>
355
+ </div>
356
+
357
+ <div style="display: inline-block;">
358
+ <a rel="noopener nofollow" href="https://wisemodel.cn/organization/01.AI">
359
+ <img src="https://img.shields.io/badge/WiseModel-01--ai-blue" style="margin: 0 0;">
360
+ </a>
361
+ </div>
362
+
363
+ <div style="display: inline-block;">
364
+ <a rel="noopener nofollow" href="https://replicate.com/01-ai">
365
+ <img src="https://img.shields.io/badge/Replicate-01--ai-blue?logo=data:image/svg%2bxml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBjbGFzcz0ibG9nbyIgZmlsbD0iY3VycmVudENvbG9yIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KICA8Zz4KICAgIDxwb2x5Z29uIHBvaW50cz0iMTAwMCw0MjcuNiAxMDAwLDU0MC42IDYwMy40LDU0MC42IDYwMy40LDEwMDAgNDc3LDEwMDAgNDc3LDQyNy42IAkiPjwvcG9seWdvbj4KICAgIDxwb2x5Z29uIHBvaW50cz0iMTAwMCwyMTMuOCAxMDAwLDMyNyAzNjQuOCwzMjcgMzY0LjgsMTAwMCAyMzguNCwxMDAwIDIzOC40LDIxMy44IAkiPjwvcG9seWdvbj4KICAgIDxwb2x5Z29uIHBvaW50cz0iMTAwMCwwIDEwMDAsMTEzLjIgMTI2LjQsMTEzLjIgMTI2LjQsMTAwMCAwLDEwMDAgMCwwIAkiPjwvcG9seWdvbj4KICA8L2c+Cjwvc3ZnPg==" style="margin: 0 0;">
366
+ </a>
367
+ </div>
368
+
369
+ <div style="display: inline-block;">
370
+ <a rel="noopener nofollow" href="https://github.com/01-ai/Yi/blob/main/LICENSE">
371
+ <img src="https://img.shields.io/badge/Code_License-Apache_2.0-lightblue" style="margin: 0 0;">
372
+ </a>
373
+ </div>
374
+
375
+ <div style="display: inline-block;">
376
+ <a rel="noopener nofollow" href="https://github.com/01-ai/Yi/blob/main/MODEL_LICENSE_AGREEMENT.txt">
377
+ <img src="https://img.shields.io/badge/Model_License-Model_Agreement-lightblue" style="margin: 0 0;">
378
+ </a>
379
+ </div>
380
+
381
+ <div style="display: inline-block;">
382
+ <a rel="noopener nofollow" href="mailto:oss@01.ai">
383
+ <img src="https://img.shields.io/badge/✉️-yi@01.ai-FFE01B" style="margin: 0 0;">
384
+ </a>
385
+ </div>
386
+
387
+ </div>
388
+
389
+ ## Introduction
390
+
391
+ The **Yi** series models are large language models trained from scratch by
392
+ developers at [01.AI](https://01.ai/).
393
+
394
+ ## News
395
+
396
+ <details open>
397
+ <summary>🎯 <b>2023/11/23</b>: The chat models are open to public.</summary>
398
+
399
+ This release contains two chat models based on previous released base models, two 8-bits models quntinized by GPTQ, two 4-bits models quantinized by AWQ.
400
+
401
+ - `Yi-34B-Chat`
402
+ - `Yi-34B-Chat-4bits`
403
+ - `Yi-34B-Chat-8bits`
404
+ - `Yi-6B-Chat`
405
+ - `Yi-6B-Chat-4bits`
406
+ - `Yi-6B-Chat-8bits`
407
+
408
+ You can try some of them interactively at:
409
+
410
+ - [HuggingFace](https://huggingface.co/spaces/01-ai/Yi-34B-Chat)
411
+ - [Replicate](https://replicate.com/01-ai)
412
+ </details>
413
+
414
+ <details open>
415
+ <summary>🔔 <b>2023/11/23</b>: The Yi Series Models Community License Agreement is updated to v2.1.</summary>
416
+ </details>
417
+
418
+ <details>
419
+ <summary>🔥 <b>2023/11/08</b>: Invited test of Yi-34B chat model.</summary>
420
+
421
+ Application form:
422
+
423
+ - [English](https://cn.mikecrm.com/l91ODJf)
424
+ - [Chinese](https://cn.mikecrm.com/gnEZjiQ)
425
+
426
+ </details>
427
+
428
+ <details>
429
+ <summary>🎯 <b>2023/11/05</b>: The base model of <code>Yi-6B-200K</code> and <code>Yi-34B-200K</code>.</summary>
430
+
431
+ This release contains two base models with the same parameter sizes of previous
432
+ release, except that the context window is extended to 200K.
433
+
434
+ </details>
435
+
436
+ <details>
437
+ <summary>🎯 <b>2023/11/02</b>: The base model of <code>Yi-6B</code> and <code>Yi-34B</code>.</summary>
438
+
439
+ The first public release contains two bilingual (English/Chinese) base models
440
+ with the parameter sizes of 6B and 34B. Both of them are trained with 4K
441
+ sequence length and can be extended to 32K during inference time.
442
+
443
+ </details>
444
+
445
+ ## Model Performance
446
+
447
+ ### Base Model Performance
448
+
449
+ | Model | MMLU | CMMLU | C-Eval | GAOKAO | BBH | Common-sense Reasoning | Reading Comprehension | Math & Code |
450
+ | :------------ | :------: | :------: | :------: | :------: | :------: | :--------------------: | :-------------------: | :---------: |
451
+ | | 5-shot | 5-shot | 5-shot | 0-shot | 3-shot@1 | - | - | - |
452
+ | LLaMA2-34B | 62.6 | - | - | - | 44.1 | 69.9 | 68.0 | 26.0 |
453
+ | LLaMA2-70B | 68.9 | 53.3 | - | 49.8 | 51.2 | 71.9 | 69.4 | 36.8 |
454
+ | Baichuan2-13B | 59.2 | 62.0 | 58.1 | 54.3 | 48.8 | 64.3 | 62.4 | 23.0 |
455
+ | Qwen-14B | 66.3 | 71.0 | 72.1 | 62.5 | 53.4 | 73.3 | 72.5 | **39.8** |
456
+ | Skywork-13B | 62.1 | 61.8 | 60.6 | 68.1 | 41.7 | 72.4 | 61.4 | 24.9 |
457
+ | InternLM-20B | 62.1 | 59.0 | 58.8 | 45.5 | 52.5 | 78.3 | - | 30.4 |
458
+ | Aquila-34B | 67.8 | 71.4 | 63.1 | - | - | - | - | - |
459
+ | Falcon-180B | 70.4 | 58.0 | 57.8 | 59.0 | 54.0 | 77.3 | 68.8 | 34.0 |
460
+ | Yi-6B | 63.2 | 75.5 | 72.0 | 72.2 | 42.8 | 72.3 | 68.7 | 19.8 |
461
+ | Yi-6B-200K | 64.0 | 75.3 | 73.5 | 73.9 | 42.0 | 72.0 | 69.1 | 19.0 |
462
+ | **Yi-34B** | **76.3** | **83.7** | 81.4 | 82.8 | **54.3** | **80.1** | 76.4 | 37.1 |
463
+ | Yi-34B-200K | 76.1 | 83.6 | **81.9** | **83.4** | 52.7 | 79.7 | **76.6** | 36.3 |
464
+
465
+ While benchmarking open-source models, we have observed a disparity between the
466
+ results generated by our pipeline and those reported in public sources (e.g.
467
+ OpenCompass). Upon conducting a more in-depth investigation of this difference,
468
+ we have discovered that various models may employ different prompts,
469
+ post-processing strategies, and sampling techniques, potentially resulting in
470
+ significant variations in the outcomes. Our prompt and post-processing strategy
471
+ remains consistent with the original benchmark, and greedy decoding is employed
472
+ during evaluation without any post-processing for the generated content. For
473
+ scores that were not reported by the original authors (including scores reported
474
+ with different settings), we try to get results with our pipeline.
475
+
476
+ To evaluate the model's capability extensively, we adopted the methodology
477
+ outlined in Llama2. Specifically, we included PIQA, SIQA, HellaSwag, WinoGrande,
478
+ ARC, OBQA, and CSQA to assess common sense reasoning. SquAD, QuAC, and BoolQ
479
+ were incorporated to evaluate reading comprehension. CSQA was exclusively tested
480
+ using a 7-shot setup, while all other tests were conducted with a 0-shot
481
+ configuration. Additionally, we introduced GSM8K (8-shot@1), MATH (4-shot@1),
482
+ HumanEval (0-shot@1), and MBPP (3-shot@1) under the category "Math & Code". Due
483
+ to technical constraints, we did not test Falcon-180 on QuAC and OBQA; the score
484
+ is derived by averaging the scores on the remaining tasks. Since the scores for
485
+ these two tasks are generally lower than the average, we believe that
486
+ Falcon-180B's performance was not underestimated.
487
+
488
+ ### Chat Model Performance
489
+
490
+ | Model | MMLU | MMLU | CMMLU | CMMLU | C-Eval(val)<sup>*</sup> | C-Eval(val)<sup>*</sup> | Truthful QA | BBH | BBH | GSM8k | GSM8k |
491
+ | ----------------------- | --------- | --------- | --------- | --------- | ----------------------- | ----------------------- | ----------- | --------- | --------- | --------- | --------- |
492
+ | | 0-shot | 5-shot | 0-shot | 5-shot | 0-shot | 5-shot | 0-shot | 0-shot | 3-shot | 0-shot | 4-shot |
493
+ | LLaMA2-13B-Chat | 50.88 | 47.33 | 27.47 | 35.08 | 27.93 | 35.88 | 36.84 | 32.90 | 58.22 | 36.85 | 2.73 |
494
+ | LLaMA2-70B-Chat | 59.42 | 59.86 | 36.10 | 40.99 | 34.99 | 41.31 | 53.95 | 42.36 | 58.53 | 47.08 | 58.68 |
495
+ | Baichuan2-13B-Chat | 55.09 | 50.14 | 58.64 | 59.47 | 56.02 | 54.75 | 48.98 | 38.81 | 47.15 | 45.72 | 23.28 |
496
+ | Qwen-14B-Chat | 63.99 | 64.98 | 67.73 | 70.57 | 66.12 | 70.06 | 52.49 | 49.65 | 54.98 | 59.51 | 61.18 |
497
+ | InternLM-Chat-20B | 55.55 | 57.42 | 53.55 | 53.75 | 51.19 | 53.57 | 51.75 | 42.41 | 36.68 | 15.69 | 43.44 |
498
+ | AquilaChat2-34B v1.2 | 65.15 | 66.70 | 67.51 | 70.02 | **82.99** | **89.38** | **64.33** | 20.12 | 34.28 | 11.52 | 48.45 |
499
+ | Yi-6B-Chat | 58.24 | 60.99 | 69.44 | 74.71 | 68.80 | 74.22 | 50.58 | 39.70 | 47.15 | 38.44 | 44.88 |
500
+ | Yi-6B-Chat-8bits(GPTQ) | 58.29 | 60.96 | 69.21 | 74.69 | 69.17 | 73.85 | 49.85 | 40.35 | 47.26 | 39.42 | 44.88 |
501
+ | Yi-6B-Chat-4bits(AWQ) | 56.78 | 59.89 | 67.70 | 73.29 | 67.53 | 72.29 | 50.29 | 37.74 | 43.62 | 35.71 | 38.36 |
502
+ | Yi-34B-Chat | **67.62** | 73.46 | **79.11** | **81.34** | 77.04 | 78.53 | 62.43 | 51.41 | **71.74** | **71.65** | **75.97** |
503
+ | Yi-34B-Chat-8bits(GPTQ) | 66.24 | **73.69** | 79.05 | 81.23 | 76.82 | 78.97 | 61.84 | **52.08** | 70.97 | 70.74 | 75.74 |
504
+ | Yi-34B-Chat-4bits(AWQ) | 65.77 | 72.42 | 78.21 | 80.50 | 75.71 | 77.27 | 61.84 | 48.30 | 69.39 | 70.51 | 74.00 |
505
+
506
+ We evaluated various benchmarks using both zero-shot and few-shot methods, except for TruthfulQA. Generally, the zero-shot approach is more common in chat models. Our evaluation strategy involves generating responses while following instructions explicitly or implicitly (such as using few-shot examples). We then isolate relevant answers from the generated text. Some models are not well-suited to produce output in the specific format required by instructions in few datasets, which leads to suboptimal results.
507
+
508
+ <strong>*</strong>: C-Eval results are evaluated on the validation datasets
509
+
510
+ ### Quantized Chat Model Performance
511
+
512
+ We also provide both 4-bit (AWQ) and 8-bit (GPTQ) quantized Yi chat models. Evaluation results on various benchmarks have shown that the quantized models have negligible losses. Additionally, they reduce the memory footprint size. After testing different configurations of prompts and generation lengths, we highly recommend following the guidelines in the memory footprint table below when selecting a device to run our models.
513
+
514
+ | | batch=1 | batch=4 | batch=16 | batch=32 |
515
+ | ----------------------- | ------- | ------- | -------- | -------- |
516
+ | Yi-34B-Chat | 65GiB | 68GiB | 76GiB | >80GiB |
517
+ | Yi-34B-Chat-8bits(GPTQ) | 35GiB | 37GiB | 46GiB | 58GiB |
518
+ | Yi-34B-Chat-4bits(AWQ) | 19GiB | 20GiB | 30GiB | 40GiB |
519
+ | Yi-6B-Chat | 12GiB | 13GiB | 15GiB | 18GiB |
520
+ | Yi-6B-Chat-8bits(GPTQ) | 7GiB | 8GiB | 10GiB | 14GiB |
521
+ | Yi-6B-Chat-4bits(AWQ) | 4GiB | 5GiB | 7GiB | 10GiB |
522
+
523
+ Note: All the numbers in the table represent the minimum recommended memory for running models of the corresponding size.
524
+
525
+ ### Limitations of Chat Model
526
+
527
+ The released chat model has undergone exclusive training using Supervised Fine-Tuning (SFT). Compared to other standard chat models, our model produces more diverse responses, making it suitable for various downstream tasks, such as creative scenarios. Furthermore, this diversity is expected to enhance the likelihood of generating higher quality responses, which will be advantageous for subsequent Reinforcement Learning (RL) training.
528
+
529
+ However, this higher diversity might amplify certain existing issues, including:
530
+
531
+ - **Hallucination**: This refers to the model generating factually incorrect or nonsensical information. With the model's responses being more varied, there's a higher chance of hallucination that are not based on accurate data or logical reasoning.
532
+ - **Non-determinism in re-generation**: When attempting to regenerate or sample responses, inconsistencies in the outcomes may occur. The increased diversity can lead to varying results even under similar input conditions.
533
+ - **Cumulative Error**: This occurs when errors in the model's responses compound over time. As the model generates more diverse responses, the likelihood of small inaccuracies building up into larger errors increases, especially in complex tasks like extended reasoning, mathematical problem-solving, etc.
534
+
535
+ To achieve more coherent and consistent responses, it is advisable to adjust generation configuration parameters such as`temperature`,`top_p`, or`top_k`. These adjustments can help in the balance between creativity and coherence in the model's outputs.
536
+
537
+
538
+
539
+ ## Usage
540
+
541
+ Feel free to [create an issue](https://github.com/01-ai/Yi/issues/new) if you
542
+ encounter any problem when using the **Yi** series models.
543
+
544
+ ### 1. Prepare development environment
545
+
546
+ #### 1.1 Docker
547
+ The best approach to try the **Yi** series models is through Docker with GPUs. We
548
+ provide the following docker images to help you get started.
549
+
550
+ - `registry.lingyiwanwu.com/ci/01-ai/yi:latest`
551
+ - `ghcr.io/01-ai/yi:latest`
552
+
553
+ Note that the `latest` tag always points to the latest code in the `main`
554
+ branch. To test a stable version, please replace it with a specific
555
+ [tag](https://github.com/01-ai/Yi/tags).
556
+
557
+ #### 1.2 Local development environment
558
+ We use [`conda-lock`](https://github.com/conda/conda-lock) to generate fully reproducible lock files for conda environments. You can refer to [conda-lock.yml](./conda-lock.yml) for the exact versions of the dependencies. Additionally, we utilize [`micromamba`](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) for installing these dependencies.
559
+
560
+ To install the dependencies, please follow these steps:
561
+ 1. Install `micromamba` by following the instructions available [here](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html).
562
+ 2. Execute `micromamba install -y -n yi -f conda-lock.yml` to create a conda environment named `yi` and install the necessary dependencies.
563
+
564
+ ### 2. Download the model (optional)
565
+
566
+ By default, the model weights and tokenizer will be downloaded from
567
+ [HuggingFace](https://huggingface.co/01-ai) automatically in the next step. You
568
+ can also download them manually from the following places:
569
+
570
+ - [ModelScope](https://www.modelscope.cn/organization/01ai/)
571
+ - [WiseModel](https://wisemodel.cn/organization/01.AI)
572
+
573
+ ### 3. Examples
574
+
575
+ #### 3.1 Use the chat model
576
+
577
+ ```python
578
+ from transformers import AutoModelForCausalLM, AutoTokenizer
579
+
580
+ model_path = '01-ai/Yi-34b-Chat'
581
+
582
+ tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
583
+
584
+ # Since transformers 4.35.0, the GPT-Q/AWQ model can be loaded using AutoModelForCausalLM.
585
+ model = AutoModelForCausalLM.from_pretrained(
586
+ model_path,
587
+ device_map="auto",
588
+ torch_dtype='auto'
589
+ ).eval()
590
+
591
+ # Prompt content: "hi"
592
+ messages = [
593
+ {"role": "user", "content": "hi"}
594
+ ]
595
+
596
+ input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
597
+ output_ids = model.generate(input_ids.to('cuda'))
598
+ response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
599
+
600
+ # Model response: "Hello! How can I assist you today?"
601
+ print(response)
602
+ ```
603
+
604
+ #### 3.2 Use the base model
605
+
606
+ ```bash
607
+ python demo/text_generation.py
608
+ ```
609
+
610
+ To reuse the downloaded models in the previous step, you can provide the extra
611
+ `--model` argument:
612
+
613
+ ```bash
614
+ python demo/text_generation.py --model /path/to/model
615
+ ```
616
+
617
+ Or if you'd like to get your hands dirty:
618
+
619
+ ```python
620
+ from transformers import AutoModelForCausalLM, AutoTokenizer
621
+
622
+ model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-34B", device_map="auto", torch_dtype="auto", trust_remote_code=True)
623
+ tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-34B", trust_remote_code=True)
624
+ inputs = tokenizer("There's a place where time stands still. A place of breath taking wonder, but also", return_tensors="pt")
625
+ max_length = 256
626
+
627
+ outputs = model.generate(
628
+ inputs.input_ids.cuda(),
629
+ max_length=max_length,
630
+ eos_token_id=tokenizer.eos_token_id,
631
+ do_sample=True,
632
+ repetition_penalty=1.3,
633
+ no_repeat_ngram_size=5,
634
+ temperature=0.7,
635
+ top_k=40,
636
+ top_p=0.8,
637
+ )
638
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
639
+ ```
640
+
641
+ <details>
642
+
643
+ <summary>Output</summary>
644
+
645
+ **Prompt**: There's a place where time stands still. A place of breath taking wonder, but also
646
+
647
+ **Generation**: There's a place where time stands still. A place of breath taking wonder, but also of great danger. A place where the very air you breathe could kill you. A place where the only way to survive is to be prepared.
648
+ The place is called the Arctic.
649
+ The Arctic is a vast, frozen wilderness. It is a place of extremes. The temperatures can drop to -40 degrees Celsius. The winds can reach speeds of 100 kilometers per hour. The sun can shine for 24 hours a day, or not at all for weeks on end.
650
+ The Arctic is also a place of great beauty. The ice and snow are a pristine white. The sky is a deep blue. The sunsets are spectacular.
651
+ But the Arctic is also a place of great danger. The ice can be treacherous. The winds can be deadly. The sun can be blinding.
652
+ The Arctic is a place where the only way to survive is to be prepared.
653
+ The Arctic is a place of extremes. The temperatures can drop to -40 degrees Celsius. The winds can reach speeds of 100 kilometers per hour. The sun can shine for 24 hours a day, or not at all for weeks on end.
654
+ The Arctic is a place of great beauty. The ice and snow are a
655
+
656
+ </details>
657
+
658
+ For more advanced usage, please refer to the
659
+ [doc](https://github.com/01-ai/Yi/tree/main/demo).
660
+
661
+ #### 3.3 Finetuning from the base model:
662
+
663
+ ```bash
664
+ bash finetune/scripts/run_sft_Yi_6b.sh
665
+ ```
666
+
667
+ Once finished, you can compare the finetuned model and the base model with the following command:
668
+
669
+ ```bash
670
+ bash finetune/scripts/run_eval.sh
671
+ ```
672
+
673
+ For more advanced usage like fine-tuning based on your custom data, please refer
674
+ the [doc](https://github.com/01-ai/Yi/tree/main/finetune).
675
+
676
+ #### 3.4 Quantization
677
+
678
+ ##### GPT-Q
679
+ ```bash
680
+ python quantization/gptq/quant_autogptq.py \
681
+ --model /base_model \
682
+ --output_dir /quantized_model \
683
+ --trust_remote_code
684
+ ```
685
+
686
+ Once finished, you can then evaluate the resulting model as follows:
687
+
688
+ ```bash
689
+ python quantization/gptq/eval_quantized_model.py \
690
+ --model /quantized_model \
691
+ --trust_remote_code
692
+ ```
693
+
694
+ For a more detailed explanation, please read the [doc](https://github.com/01-ai/Yi/tree/main/quantization/gptq)
695
+
696
+ ##### AWQ
697
+ ```bash
698
+ python quantization/awq/quant_autoawq.py \
699
+ --model /base_model \
700
+ --output_dir /quantized_model \
701
+ --trust_remote_code
702
+ ```
703
+
704
+ Once finished, you can then evaluate the resulted model as follows:
705
+
706
+ ```bash
707
+ python quantization/awq/eval_quantized_model.py \
708
+ --model /quantized_model \
709
+ --trust_remote_code
710
+ ```
711
+
712
+ For more detailed explanation, please read the [doc](https://github.com/01-ai/Yi/tree/main/quantization/awq)
713
+
714
+ ## Ecosystem
715
+
716
+ 🤗 You are encouraged to create a PR and share your awesome work built on top of
717
+ the Yi series models.
718
+
719
+ - Serving
720
+ - [ScaleLLM](https://github.com/vectorch-ai/ScaleLLM#supported-models): Efficiently run Yi models locally.
721
+ - Quantization
722
+ - [TheBloke/Yi-34B-GGUF](https://huggingface.co/TheBloke/Yi-34B-GGUF)
723
+ - [TheBloke/Yi-34B-GPTQ](https://huggingface.co/TheBloke/Yi-34B-GPTQ)
724
+ - Finetuning
725
+ - [NousResearch/Nous-Capybara-34B](https://huggingface.co/NousResearch/Nous-Capybara-34B)
726
+
727
+ ## FAQ
728
+
729
+ 1. **What dataset was this trained with?**
730
+
731
+ The dataset we use contains Chinese & English only. We used approximately 3T
732
+ tokens. The detailed number and its construction will be described in the
733
+ upcoming technical report.
734
+
735
+ ## Disclaimer
736
+
737
+ We use data compliance checking algorithms during the training process, to
738
+ ensure the compliance of the trained model to the best of our ability. Due to
739
+ complex data and the diversity of language model usage scenarios, we cannot
740
+ guarantee that the model will generate correct, and reasonable output in all
741
+ scenarios. Please be aware that there is still a risk of the model producing
742
+ problematic outputs. We will not be responsible for any risks and issues
743
+ resulting from misuse, misguidance, illegal usage, and related misinformation,
744
+ as well as any associated data security concerns.
745
+
746
+ ## License
747
+
748
+ The source code in this repo is licensed under the [Apache 2.0
749
+ license](https://github.com/01-ai/Yi/blob/main/LICENSE). The Yi series models
750
+ are fully open for academic research and free commercial usage with permission
751
+ via applications. All usage must adhere to the [Model License
752
+ Agreement 2.0](https://github.com/01-ai/Yi/blob/main/MODEL_LICENSE_AGREEMENT.txt).
753
+ To apply for the official commercial license, please contact us
754
+ ([yi@01.ai](mailto:yi@01.ai)).
755
+
756
+ <!-- original-model-card end -->