TheBloke commited on
Commit
45d5e93
1 Parent(s): 82f4c40

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +394 -0
README.md ADDED
@@ -0,0 +1,394 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: OrionStarAI/OrionStar-Yi-34B-Chat-Llama
3
+ inference: false
4
+ license: other
5
+ license_link: LICENSE
6
+ license_name: yi-license
7
+ model_creator: OrionStarAI
8
+ model_name: OrionStar Yi 34B Chat Llama
9
+ model_type: yi
10
+ pipeline_tag: text-generation
11
+ prompt_template: 'Human: {prompt}
12
+
13
+
14
+ Assistant:
15
+
16
+ '
17
+ quantized_by: TheBloke
18
+ widget:
19
+ - output:
20
+ text: "\u4F60\u597D\uFF0C\u6211\u7684\u540D\u5B57\u53EB\u805A\u8A00\uFF0C\u5F88\
21
+ \u9AD8\u5174\u89C1\u5230\u4F60\u3002"
22
+ text: "\u4F60\u597D! \u4F60\u53EB\u4EC0\u4E48\u540D\u5B57!"
23
+ ---
24
+ <!-- markdownlint-disable MD041 -->
25
+
26
+ <!-- header start -->
27
+ <!-- 200823 -->
28
+ <div style="width: auto; margin-left: auto; margin-right: auto">
29
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
30
+ </div>
31
+ <div style="display: flex; justify-content: space-between; width: 100%;">
32
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
33
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
34
+ </div>
35
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
36
+ <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>
37
+ </div>
38
+ </div>
39
+ <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>
40
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
41
+ <!-- header end -->
42
+
43
+ # OrionStar Yi 34B Chat Llama - AWQ
44
+ - Model creator: [OrionStarAI](https://huggingface.co/OrionStarAI)
45
+ - Original model: [OrionStar Yi 34B Chat Llama](https://huggingface.co/OrionStarAI/OrionStar-Yi-34B-Chat-Llama)
46
+
47
+ <!-- description start -->
48
+ ## Description
49
+
50
+ This repo contains AWQ model files for [OrionStarAI's OrionStar Yi 34B Chat Llama](https://huggingface.co/OrionStarAI/OrionStar-Yi-34B-Chat-Llama).
51
+
52
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
53
+
54
+
55
+ ### About AWQ
56
+
57
+ AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference with equivalent or better quality compared to the most commonly used GPTQ settings.
58
+
59
+ It is supported by:
60
+
61
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
62
+ - [vLLM](https://github.com/vllm-project/vllm) - Llama and Mistral models only
63
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
64
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
65
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
66
+
67
+ <!-- description end -->
68
+ <!-- repositories-available start -->
69
+ ## Repositories available
70
+
71
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ)
72
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/OrionStar-Yi-34B-Chat-Llama-GPTQ)
73
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/OrionStar-Yi-34B-Chat-Llama-GGUF)
74
+ * [OrionStarAI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/OrionStarAI/OrionStar-Yi-34B-Chat-Llama)
75
+ <!-- repositories-available end -->
76
+
77
+ <!-- prompt-template start -->
78
+ ## Prompt template: Human-Assistant
79
+
80
+ ```
81
+ Human: {prompt}
82
+
83
+ Assistant:
84
+
85
+ ```
86
+
87
+ <!-- prompt-template end -->
88
+
89
+
90
+ <!-- README_AWQ.md-provided-files start -->
91
+ ## Provided files, and AWQ parameters
92
+
93
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
94
+
95
+ Models are released as sharded safetensors files.
96
+
97
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
98
+ | ------ | ---- | -- | ----------- | ------- | ---- |
99
+ | [main](https://huggingface.co/TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ/tree/main) | 4 | 128 | [open-instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 19.23 GB
100
+
101
+ <!-- README_AWQ.md-provided-files end -->
102
+
103
+ <!-- README_AWQ.md-text-generation-webui start -->
104
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
105
+
106
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
107
+
108
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
109
+
110
+ 1. Click the **Model tab**.
111
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ`.
112
+ 3. Click **Download**.
113
+ 4. The model will start downloading. Once it's finished it will say "Done".
114
+ 5. In the top left, click the refresh icon next to **Model**.
115
+ 6. In the **Model** dropdown, choose the model you just downloaded: `OrionStar-Yi-34B-Chat-Llama-AWQ`
116
+ 7. Select **Loader: AutoAWQ**.
117
+ 8. Click Load, and the model will load and is now ready for use.
118
+ 9. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
119
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
120
+ <!-- README_AWQ.md-text-generation-webui end -->
121
+
122
+ <!-- README_AWQ.md-use-from-vllm start -->
123
+ ## Multi-user inference server: vLLM
124
+
125
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
126
+
127
+ - Please ensure you are using vLLM version 0.2 or later.
128
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
129
+
130
+ For example:
131
+
132
+ ```shell
133
+ python3 -m vllm.entrypoints.api_server --model TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ --quantization awq --dtype auto
134
+ ```
135
+
136
+ - When using vLLM from Python code, again set `quantization=awq`.
137
+
138
+ For example:
139
+
140
+ ```python
141
+ from vllm import LLM, SamplingParams
142
+
143
+ prompts = [
144
+ "Tell me about AI",
145
+ "Write a story about llamas",
146
+ "What is 291 - 150?",
147
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
148
+ ]
149
+ prompt_template=f'''Human: {prompt}
150
+
151
+ Assistant:
152
+ '''
153
+
154
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
155
+
156
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
157
+
158
+ llm = LLM(model="TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ", quantization="awq", dtype="auto")
159
+
160
+ outputs = llm.generate(prompts, sampling_params)
161
+
162
+ # Print the outputs.
163
+ for output in outputs:
164
+ prompt = output.prompt
165
+ generated_text = output.outputs[0].text
166
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
167
+ ```
168
+ <!-- README_AWQ.md-use-from-vllm start -->
169
+
170
+ <!-- README_AWQ.md-use-from-tgi start -->
171
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
172
+
173
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
174
+
175
+ Example Docker parameters:
176
+
177
+ ```shell
178
+ --model-id TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
179
+ ```
180
+
181
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
182
+
183
+ ```shell
184
+ pip3 install huggingface-hub
185
+ ```
186
+
187
+ ```python
188
+ from huggingface_hub import InferenceClient
189
+
190
+ endpoint_url = "https://your-endpoint-url-here"
191
+
192
+ prompt = "Tell me about AI"
193
+ prompt_template=f'''Human: {prompt}
194
+
195
+ Assistant:
196
+ '''
197
+
198
+ client = InferenceClient(endpoint_url)
199
+ response = client.text_generation(prompt,
200
+ max_new_tokens=128,
201
+ do_sample=True,
202
+ temperature=0.7,
203
+ top_p=0.95,
204
+ top_k=40,
205
+ repetition_penalty=1.1)
206
+
207
+ print(f"Model output: ", response)
208
+ ```
209
+ <!-- README_AWQ.md-use-from-tgi end -->
210
+
211
+ <!-- README_AWQ.md-use-from-python start -->
212
+ ## Inference from Python code using Transformers
213
+
214
+ ### Install the necessary packages
215
+
216
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
217
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
218
+
219
+ ```shell
220
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
221
+ ```
222
+
223
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
224
+
225
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
226
+
227
+ ```shell
228
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
229
+ ```
230
+
231
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
232
+
233
+ ```shell
234
+ pip3 uninstall -y autoawq
235
+ git clone https://github.com/casper-hansen/AutoAWQ
236
+ cd AutoAWQ
237
+ pip3 install .
238
+ ```
239
+
240
+ ### Transformers example code (requires Transformers 4.35.0 and later)
241
+
242
+ ```python
243
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
244
+
245
+ model_name_or_path = "TheBloke/OrionStar-Yi-34B-Chat-Llama-AWQ"
246
+
247
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
248
+ model = AutoModelForCausalLM.from_pretrained(
249
+ model_name_or_path,
250
+ low_cpu_mem_usage=True,
251
+ device_map="cuda:0"
252
+ )
253
+
254
+ # Using the text streamer to stream output one token at a time
255
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
256
+
257
+ prompt = "Tell me about AI"
258
+ prompt_template=f'''Human: {prompt}
259
+
260
+ Assistant:
261
+ '''
262
+
263
+ # Convert prompt to tokens
264
+ tokens = tokenizer(
265
+ prompt_template,
266
+ return_tensors='pt'
267
+ ).input_ids.cuda()
268
+
269
+ generation_params = {
270
+ "do_sample": True,
271
+ "temperature": 0.7,
272
+ "top_p": 0.95,
273
+ "top_k": 40,
274
+ "max_new_tokens": 512,
275
+ "repetition_penalty": 1.1
276
+ }
277
+
278
+ # Generate streamed output, visible one token at a time
279
+ generation_output = model.generate(
280
+ tokens,
281
+ streamer=streamer,
282
+ **generation_params
283
+ )
284
+
285
+ # Generation without a streamer, which will include the prompt in the output
286
+ generation_output = model.generate(
287
+ tokens,
288
+ **generation_params
289
+ )
290
+
291
+ # Get the tokens from the output, decode them, print them
292
+ token_output = generation_output[0]
293
+ text_output = tokenizer.decode(token_output)
294
+ print("model.generate output: ", text_output)
295
+
296
+ # Inference is also possible via Transformers' pipeline
297
+ from transformers import pipeline
298
+
299
+ pipe = pipeline(
300
+ "text-generation",
301
+ model=model,
302
+ tokenizer=tokenizer,
303
+ **generation_params
304
+ )
305
+
306
+ pipe_output = pipe(prompt_template)[0]['generated_text']
307
+ print("pipeline output: ", pipe_output)
308
+
309
+ ```
310
+ <!-- README_AWQ.md-use-from-python end -->
311
+
312
+ <!-- README_AWQ.md-compatibility start -->
313
+ ## Compatibility
314
+
315
+ The files provided are tested to work with:
316
+
317
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
318
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
319
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
320
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
321
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
322
+
323
+ <!-- README_AWQ.md-compatibility end -->
324
+
325
+ <!-- footer start -->
326
+ <!-- 200823 -->
327
+ ## Discord
328
+
329
+ For further support, and discussions on these models and AI in general, join us at:
330
+
331
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
332
+
333
+ ## Thanks, and how to contribute
334
+
335
+ Thanks to the [chirper.ai](https://chirper.ai) team!
336
+
337
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
338
+
339
+ 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.
340
+
341
+ 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.
342
+
343
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
344
+
345
+ * Patreon: https://patreon.com/TheBlokeAI
346
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
347
+
348
+ **Special thanks to**: Aemon Algiz.
349
+
350
+ **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
351
+
352
+
353
+ Thank you to all my generous patrons and donaters!
354
+
355
+ And thank you again to a16z for their generous grant.
356
+
357
+ <!-- footer end -->
358
+
359
+ # Original model card: OrionStarAI's OrionStar Yi 34B Chat Llama
360
+
361
+
362
+ [OrionStarAI/OrionStar-Yi-34B-Chat](https://huggingface.co/OrionStarAI/OrionStar-Yi-34B-Chat/tree/main) with tensors renamed to match standard Llama modelling code.
363
+
364
+ # Model Introduction
365
+
366
+ - OrionStar-Yi-34B-Chat from OrionStarAI is based on the open-source Yi-34B model, fine-tuned on a high-quality corpus
367
+ of over 15 million sentences. OrionStar-Yi-34B-Chat aims to provide an excellent interactive experience for users in
368
+ the large model community.
369
+
370
+ - The Yi series models, open-sourced by the 01-ai team, have shown impressive performance on various benchmarks in
371
+ Chinese, English, and general domains. OrionStar-Yi-34B-Chat further explores the potential of Yi-34B. Through
372
+ extensive fine-tuning on a large and high-quality corpus, OrionStar-Yi-34B-Chat performs exceptionally well on
373
+ evaluation data. We strive to make it an outstanding open-source alternative in the ChatGPT domain!
374
+
375
+ - Our fine-tuned model is completely open for academic research, but please adhere to the [agreement](#license) and
376
+ the [Yi License](https://github.com/01-ai/Yi/blob/main/MODEL_LICENSE_AGREEMENT.txt).
377
+
378
+ - Model Evaluation Results
379
+
380
+ We use [opencompass](https://opencompass.org.cn) to perform 5-shot on the following general domain datasets Testing.
381
+ The evaluation results of other models are taken
382
+ from [opencompass leaderboard](https://opencompass.org.cn/leaderboard-llm).
383
+
384
+ | | C-Eval | MMLU | CMMLU |
385
+ |---------------------------|-----------|--------|-----------|
386
+ | **GPT-4** | 69.9 | **83** | 71 |
387
+ | **ChatGPT** | 52.5 | 69.1 | 53.9 |
388
+ | **Claude-1** | 52 | 65.7 | - |
389
+ | **TigerBot-70B-Chat-V2** | 57.7 | 65.9 | 59.9 |
390
+ | **WeMix-LLaMA2-70B** | 55.2 | 71.3 | 56 |
391
+ | **LLaMA-2-70B-Chat** | 44.3 | 63.8 | 43.3 |
392
+ | **Qwen-14B-Chat** | 71.7 | 66.4 | 70 |
393
+ | **Baichuan2-13B-Chat** | 56.7 | 57 | 58.4 |
394
+ | **OrionStar-Yi-34B-Chat** | **77.71** | 78.32 | **73.52** |