TheBloke commited on
Commit
f6bf329
1 Parent(s): c936b30

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +497 -0
README.md ADDED
@@ -0,0 +1,497 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: NickyNicky/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1
3
+ datasets:
4
+ - Open-Orca/OpenOrca
5
+ - OpenAssistant/oasst_top1_2023-08-25
6
+ inference: false
7
+ language:
8
+ - bg
9
+ - ca
10
+ - cs
11
+ - da
12
+ - de
13
+ - en
14
+ - es
15
+ - fr
16
+ - hr
17
+ - hu
18
+ - it
19
+ - nl
20
+ - pl
21
+ - pt
22
+ - ro
23
+ - ru
24
+ - sl
25
+ - sr
26
+ - sv
27
+ - uk
28
+ library_name: transformers
29
+ license: apache-2.0
30
+ model_creator: Nicky
31
+ model_name: Mistral 7B OpenOrca oasst Top1 2023 08 25 v1
32
+ model_type: mistral
33
+ prompt_template: '<|im_start|>system
34
+
35
+ {system_message}<|im_end|>
36
+
37
+ <|im_start|>user
38
+
39
+ {prompt}<|im_end|>
40
+
41
+ <|im_start|>assistant
42
+
43
+ '
44
+ quantized_by: TheBloke
45
+ ---
46
+ <!-- markdownlint-disable MD041 -->
47
+
48
+ <!-- header start -->
49
+ <!-- 200823 -->
50
+ <div style="width: auto; margin-left: auto; margin-right: auto">
51
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
52
+ </div>
53
+ <div style="display: flex; justify-content: space-between; width: 100%;">
54
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
55
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
56
+ </div>
57
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
58
+ <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>
59
+ </div>
60
+ </div>
61
+ <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>
62
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
63
+ <!-- header end -->
64
+
65
+ # Mistral 7B OpenOrca oasst Top1 2023 08 25 v1 - GPTQ
66
+ - Model creator: [Nicky](https://huggingface.co/NickyNicky)
67
+ - Original model: [Mistral 7B OpenOrca oasst Top1 2023 08 25 v1](https://huggingface.co/NickyNicky/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1)
68
+
69
+ <!-- description start -->
70
+ ## Description
71
+
72
+ This repo contains GPTQ model files for [Nicky's Mistral 7B OpenOrca oasst Top1 2023 08 25 v1](https://huggingface.co/NickyNicky/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1).
73
+
74
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
75
+
76
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
77
+
78
+ <!-- description end -->
79
+ <!-- repositories-available start -->
80
+ ## Repositories available
81
+
82
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-AWQ)
83
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ)
84
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GGUF)
85
+ * [Nicky's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/NickyNicky/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1)
86
+ <!-- repositories-available end -->
87
+
88
+ <!-- prompt-template start -->
89
+ ## Prompt template: ChatML
90
+
91
+ ```
92
+ <|im_start|>system
93
+ {system_message}<|im_end|>
94
+ <|im_start|>user
95
+ {prompt}<|im_end|>
96
+ <|im_start|>assistant
97
+
98
+ ```
99
+
100
+ <!-- prompt-template end -->
101
+
102
+
103
+
104
+ <!-- README_GPTQ.md-compatible clients start -->
105
+ ## Known compatible clients / servers
106
+
107
+ These GPTQ models are known to work in the following inference servers/webuis.
108
+
109
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
110
+ - [KoboldAI United](https://github.com/henk717/koboldai)
111
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
112
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
113
+
114
+ This may not be a complete list; if you know of others, please let me know!
115
+ <!-- README_GPTQ.md-compatible clients end -->
116
+
117
+ <!-- README_GPTQ.md-provided-files start -->
118
+ ## Provided files, and GPTQ parameters
119
+
120
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
121
+
122
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
123
+
124
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
125
+
126
+ <details>
127
+ <summary>Explanation of GPTQ parameters</summary>
128
+
129
+ - Bits: The bit size of the quantised model.
130
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
131
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
132
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
133
+ - GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
134
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
135
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
136
+
137
+ </details>
138
+
139
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
140
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
141
+ | [main](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
142
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
143
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
144
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
145
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
146
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-raw-v1) | 4096 | 4.30 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
147
+
148
+ <!-- README_GPTQ.md-provided-files end -->
149
+
150
+ <!-- README_GPTQ.md-download-from-branches start -->
151
+ ## How to download, including from branches
152
+
153
+ ### In text-generation-webui
154
+
155
+ To download from the `main` branch, enter `TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ` in the "Download model" box.
156
+
157
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ:gptq-4bit-32g-actorder_True`
158
+
159
+ ### From the command line
160
+
161
+ I recommend using the `huggingface-hub` Python library:
162
+
163
+ ```shell
164
+ pip3 install huggingface-hub
165
+ ```
166
+
167
+ To download the `main` branch to a folder called `Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ`:
168
+
169
+ ```shell
170
+ mkdir Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ
171
+ huggingface-cli download TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --local-dir Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --local-dir-use-symlinks False
172
+ ```
173
+
174
+ To download from a different branch, add the `--revision` parameter:
175
+
176
+ ```shell
177
+ mkdir Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ
178
+ huggingface-cli download TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --local-dir-use-symlinks False
179
+ ```
180
+
181
+ <details>
182
+ <summary>More advanced huggingface-cli download usage</summary>
183
+
184
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
185
+
186
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
187
+
188
+ 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).
189
+
190
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
191
+
192
+ ```shell
193
+ pip3 install hf_transfer
194
+ ```
195
+
196
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
197
+
198
+ ```shell
199
+ mkdir Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ
200
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --local-dir Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --local-dir-use-symlinks False
201
+ ```
202
+
203
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
204
+ </details>
205
+
206
+ ### With `git` (**not** recommended)
207
+
208
+ To clone a specific branch with `git`, use a command like this:
209
+
210
+ ```shell
211
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ
212
+ ```
213
+
214
+ Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
215
+
216
+ <!-- README_GPTQ.md-download-from-branches end -->
217
+ <!-- README_GPTQ.md-text-generation-webui start -->
218
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
219
+
220
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
221
+
222
+ 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.
223
+
224
+ 1. Click the **Model tab**.
225
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ`.
226
+
227
+ - To download from a specific branch, enter for example `TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ:gptq-4bit-32g-actorder_True`
228
+ - see Provided Files above for the list of branches for each option.
229
+
230
+ 3. Click **Download**.
231
+ 4. The model will start downloading. Once it's finished it will say "Done".
232
+ 5. In the top left, click the refresh icon next to **Model**.
233
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ`
234
+ 7. The model will automatically load, and is now ready for use!
235
+ 8. 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.
236
+
237
+ - Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
238
+
239
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
240
+
241
+ <!-- README_GPTQ.md-text-generation-webui end -->
242
+
243
+ <!-- README_GPTQ.md-use-from-tgi start -->
244
+ ## Serving this model from Text Generation Inference (TGI)
245
+
246
+ It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
247
+
248
+ Example Docker parameters:
249
+
250
+ ```shell
251
+ --model-id TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
252
+ ```
253
+
254
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
255
+
256
+ ```shell
257
+ pip3 install huggingface-hub
258
+ ```
259
+
260
+ ```python
261
+ from huggingface_hub import InferenceClient
262
+
263
+ endpoint_url = "https://your-endpoint-url-here"
264
+
265
+ prompt = "Tell me about AI"
266
+ prompt_template=f'''<|im_start|>system
267
+ {system_message}<|im_end|>
268
+ <|im_start|>user
269
+ {prompt}<|im_end|>
270
+ <|im_start|>assistant
271
+ '''
272
+
273
+ client = InferenceClient(endpoint_url)
274
+ response = client.text_generation(prompt,
275
+ max_new_tokens=128,
276
+ do_sample=True,
277
+ temperature=0.7,
278
+ top_p=0.95,
279
+ top_k=40,
280
+ repetition_penalty=1.1)
281
+
282
+ print(f"Model output: {response}")
283
+ ```
284
+ <!-- README_GPTQ.md-use-from-tgi end -->
285
+ <!-- README_GPTQ.md-use-from-python start -->
286
+ ## How to use this GPTQ model from Python code
287
+
288
+ ### Install the necessary packages
289
+
290
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
291
+
292
+ ```shell
293
+ pip3 install transformers optimum
294
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
295
+ ```
296
+
297
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
298
+
299
+ ```shell
300
+ pip3 uninstall -y auto-gptq
301
+ git clone https://github.com/PanQiWei/AutoGPTQ
302
+ cd AutoGPTQ
303
+ git checkout v0.4.2
304
+ pip3 install .
305
+ ```
306
+
307
+ ### You can then use the following code
308
+
309
+ ```python
310
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
311
+
312
+ model_name_or_path = "TheBloke/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1-GPTQ"
313
+ # To use a different branch, change revision
314
+ # For example: revision="gptq-4bit-32g-actorder_True"
315
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
316
+ device_map="auto",
317
+ trust_remote_code=False,
318
+ revision="main")
319
+
320
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
321
+
322
+ prompt = "Tell me about AI"
323
+ prompt_template=f'''<|im_start|>system
324
+ {system_message}<|im_end|>
325
+ <|im_start|>user
326
+ {prompt}<|im_end|>
327
+ <|im_start|>assistant
328
+ '''
329
+
330
+ print("\n\n*** Generate:")
331
+
332
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
333
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
334
+ print(tokenizer.decode(output[0]))
335
+
336
+ # Inference can also be done using transformers' pipeline
337
+
338
+ print("*** Pipeline:")
339
+ pipe = pipeline(
340
+ "text-generation",
341
+ model=model,
342
+ tokenizer=tokenizer,
343
+ max_new_tokens=512,
344
+ do_sample=True,
345
+ temperature=0.7,
346
+ top_p=0.95,
347
+ top_k=40,
348
+ repetition_penalty=1.1
349
+ )
350
+
351
+ print(pipe(prompt_template)[0]['generated_text'])
352
+ ```
353
+ <!-- README_GPTQ.md-use-from-python end -->
354
+
355
+ <!-- README_GPTQ.md-compatibility start -->
356
+ ## Compatibility
357
+
358
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
359
+
360
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
361
+
362
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
363
+ <!-- README_GPTQ.md-compatibility end -->
364
+
365
+ <!-- footer start -->
366
+ <!-- 200823 -->
367
+ ## Discord
368
+
369
+ For further support, and discussions on these models and AI in general, join us at:
370
+
371
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
372
+
373
+ ## Thanks, and how to contribute
374
+
375
+ Thanks to the [chirper.ai](https://chirper.ai) team!
376
+
377
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
378
+
379
+ 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.
380
+
381
+ 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.
382
+
383
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
384
+
385
+ * Patreon: https://patreon.com/TheBlokeAI
386
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
387
+
388
+ **Special thanks to**: Aemon Algiz.
389
+
390
+ **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
391
+
392
+
393
+ Thank you to all my generous patrons and donaters!
394
+
395
+ And thank you again to a16z for their generous grant.
396
+
397
+ <!-- footer end -->
398
+
399
+ # Original model card: Nicky's Mistral 7B OpenOrca oasst Top1 2023 08 25 v1
400
+
401
+
402
+ ```
403
+ reference-data-model:
404
+
405
+ datasets:
406
+ - OpenAssistant/oasst_top1_2023-08-25:
407
+ Lang: "bg,ca,cs,da,de,en,es,fr,hr,hu,it,nl,pl,pt,ro,ru,sl,sr,sv,uk"
408
+ Link: https://huggingface.co/datasets/OpenAssistant/oasst_top1_2023-08-25
409
+
410
+ model:
411
+ - Open-Orca/Mistral-7B-OpenOrca
412
+ Link: https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca
413
+
414
+ 100 examples of generating:
415
+ Link: https://docs.google.com/spreadsheets/d/1_4rqFnhgvjA7trwAaEidaRWczAMzuKpw/edit?usp=sharing&ouid=116592149115238887304&rtpof=true&sd=true
416
+
417
+ Version 2:
418
+ Link: https://huggingface.co/NickyNicky/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v2
419
+
420
+ ```
421
+
422
+
423
+ ## Version
424
+ ```py
425
+ import torch, transformers,torchvision
426
+ torch.__version__,transformers.__version__, torchvision.__version__
427
+ #OUTPUTS: ('2.0.1+cu118', '4.34.0.dev0', '0.15.2+cu118')
428
+ ```
429
+
430
+ ## How to use
431
+ ```py
432
+
433
+ from transformers import (
434
+ AutoModelForCausalLM,
435
+ AutoTokenizer,
436
+ BitsAndBytesConfig,
437
+ HfArgumentParser,
438
+ TrainingArguments,
439
+ pipeline,
440
+ logging,
441
+ GenerationConfig,
442
+ TextIteratorStreamer,
443
+ )
444
+ import torch
445
+
446
+ # model_id = 'Open-Orca/Mistral-7B-OpenOrca'
447
+ model_id='NickyNicky/Mistral-7B-OpenOrca-oasst_top1_2023-08-25-v1'
448
+
449
+ model = AutoModelForCausalLM.from_pretrained(model_id,
450
+ device_map="auto",
451
+ trust_remote_code=True,
452
+ torch_dtype=torch.bfloat16,
453
+ load_in_4bit=True,
454
+ low_cpu_mem_usage= True,
455
+ )
456
+
457
+ max_length=2048
458
+ print("max_length",max_length)
459
+
460
+
461
+ tokenizer = AutoTokenizer.from_pretrained(model_id,
462
+ # use_fast = False,
463
+ max_length=max_length,)
464
+
465
+ tokenizer.pad_token = tokenizer.eos_token
466
+ tokenizer.padding_side = 'right'
467
+
468
+ #EXAMPLE #1
469
+ txt="""<|im_start|>user
470
+ I'm looking for an efficient Python script to output prime numbers. Can you help me out? I'm interested in a script that can handle large numbers and output them quickly. Also, it would be great if the script could take a range of numbers as input and output all the prime numbers within that range. Can you generate a script that fits these requirements? Thanks!<|im_end|>
471
+ <|im_start|>assistant
472
+ """
473
+
474
+ #EXAMPLE #2
475
+ txt="""<|im_start|>user
476
+ Estoy desarrollando una REST API con Nodejs, y estoy tratando de aplicar algún sistema de seguridad, ya sea con tokens o algo similar, me puedes ayudar?<|im_end|>
477
+ <|im_start|>assistant
478
+ """
479
+
480
+ inputs = tokenizer.encode(txt, return_tensors="pt").to("cuda")
481
+
482
+ generation_config = GenerationConfig(
483
+ max_new_tokens=max_new_tokens,
484
+ temperature=0.7,
485
+ top_p=0.9,
486
+ top_k=len_tokens,
487
+ repetition_penalty=1.11,
488
+ do_sample=True,
489
+ # pad_token_id=tokenizer.eos_token_id,
490
+ # eos_token_id=tokenizer.eos_token_id,
491
+ # use_cache=True,
492
+ # stopping_criteria= StoppingCriteriaList([stopping_criteria]),
493
+ )
494
+ outputs = model.generate(generation_config=generation_config,
495
+ input_ids=inputs,)
496
+ tokenizer.decode(outputs[0], skip_special_tokens=False) #True
497
+ ```