TheBloke commited on
Commit
9af814e
1 Parent(s): eb64cf3

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +507 -0
README.md ADDED
@@ -0,0 +1,507 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: bofenghuang/vigogne-2-70b-chat
3
+ inference: false
4
+ language: fr
5
+ license: llama2
6
+ model_creator: bofeng huang
7
+ model_name: Vigogne 2 70B Chat
8
+ model_type: llama
9
+ pipeline_tag: text-generation
10
+ prompt_template: "<s>[INST] <<SYS>>\nVous \xEAtes Vigogne, un assistant IA cr\xE9\xE9\
11
+ \ par Zaion Lab. Vous suivez extr\xEAmement bien les instructions. Aidez autant\
12
+ \ que vous le pouvez.\n<</SYS>>\n\n{prompt} [/INST] \n"
13
+ quantized_by: TheBloke
14
+ tags:
15
+ - LLM
16
+ - llama-2
17
+ - finetuned
18
+ ---
19
+ <!-- markdownlint-disable MD041 -->
20
+
21
+ <!-- header start -->
22
+ <!-- 200823 -->
23
+ <div style="width: auto; margin-left: auto; margin-right: auto">
24
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
25
+ </div>
26
+ <div style="display: flex; justify-content: space-between; width: 100%;">
27
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
28
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
29
+ </div>
30
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
31
+ <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>
32
+ </div>
33
+ </div>
34
+ <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>
35
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
36
+ <!-- header end -->
37
+
38
+ # Vigogne 2 70B Chat - GPTQ
39
+ - Model creator: [bofeng huang](https://huggingface.co/bofenghuang)
40
+ - Original model: [Vigogne 2 70B Chat](https://huggingface.co/bofenghuang/vigogne-2-70b-chat)
41
+
42
+ <!-- description start -->
43
+ ## Description
44
+
45
+ This repo contains GPTQ model files for [bofeng huang's Vigogne 2 70B Chat](https://huggingface.co/bofenghuang/vigogne-2-70b-chat).
46
+
47
+ 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.
48
+
49
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
50
+
51
+ <!-- description end -->
52
+ <!-- repositories-available start -->
53
+ ## Repositories available
54
+
55
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/vigogne-2-70B-chat-AWQ)
56
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ)
57
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GGUF)
58
+ * [bofeng huang's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/bofenghuang/vigogne-2-70b-chat)
59
+ <!-- repositories-available end -->
60
+
61
+ <!-- prompt-template start -->
62
+ ## Prompt template: Vigogne-Llama-2-Chat
63
+
64
+ ```
65
+ <s>[INST] <<SYS>>
66
+ Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.
67
+ <</SYS>>
68
+
69
+ {prompt} [/INST]
70
+
71
+ ```
72
+
73
+ <!-- prompt-template end -->
74
+
75
+
76
+
77
+ <!-- README_GPTQ.md-compatible clients start -->
78
+ ## Known compatible clients / servers
79
+
80
+ These GPTQ models are known to work in the following inference servers/webuis.
81
+
82
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
83
+ - [KoboldAI United](https://github.com/henk717/koboldai)
84
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
85
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
86
+
87
+ This may not be a complete list; if you know of others, please let me know!
88
+ <!-- README_GPTQ.md-compatible clients end -->
89
+
90
+ <!-- README_GPTQ.md-provided-files start -->
91
+ ## Provided files, and GPTQ parameters
92
+
93
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
94
+
95
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
96
+
97
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
98
+
99
+ <details>
100
+ <summary>Explanation of GPTQ parameters</summary>
101
+
102
+ - Bits: The bit size of the quantised model.
103
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
104
+ - 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.
105
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
106
+ - 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).
107
+ - 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.
108
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
109
+
110
+ </details>
111
+
112
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
113
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
114
+ | [main](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [french](https://huggingface.co/datasets/Kant1/French_Wikipedia_articles/viewer/) | 4096 | 35.33 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
115
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [french](https://huggingface.co/datasets/Kant1/French_Wikipedia_articles/viewer/) | 4096 | 36.65 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
116
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [french](https://huggingface.co/datasets/Kant1/French_Wikipedia_articles/viewer/) | 4096 | 40.66 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
117
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [french](https://huggingface.co/datasets/Kant1/French_Wikipedia_articles/viewer/) | 4096 | 26.77 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
118
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [french](https://huggingface.co/datasets/Kant1/French_Wikipedia_articles/viewer/) | 4096 | 28.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
119
+ | [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [french](https://huggingface.co/datasets/Kant1/French_Wikipedia_articles/viewer/) | 4096 | 31.84 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
120
+
121
+ <!-- README_GPTQ.md-provided-files end -->
122
+
123
+ <!-- README_GPTQ.md-download-from-branches start -->
124
+ ## How to download, including from branches
125
+
126
+ ### In text-generation-webui
127
+
128
+ To download from the `main` branch, enter `TheBloke/vigogne-2-70B-chat-GPTQ` in the "Download model" box.
129
+
130
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/vigogne-2-70B-chat-GPTQ:gptq-4bit-128g-actorder_True`
131
+
132
+ ### From the command line
133
+
134
+ I recommend using the `huggingface-hub` Python library:
135
+
136
+ ```shell
137
+ pip3 install huggingface-hub
138
+ ```
139
+
140
+ To download the `main` branch to a folder called `vigogne-2-70B-chat-GPTQ`:
141
+
142
+ ```shell
143
+ mkdir vigogne-2-70B-chat-GPTQ
144
+ huggingface-cli download TheBloke/vigogne-2-70B-chat-GPTQ --local-dir vigogne-2-70B-chat-GPTQ --local-dir-use-symlinks False
145
+ ```
146
+
147
+ To download from a different branch, add the `--revision` parameter:
148
+
149
+ ```shell
150
+ mkdir vigogne-2-70B-chat-GPTQ
151
+ huggingface-cli download TheBloke/vigogne-2-70B-chat-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir vigogne-2-70B-chat-GPTQ --local-dir-use-symlinks False
152
+ ```
153
+
154
+ <details>
155
+ <summary>More advanced huggingface-cli download usage</summary>
156
+
157
+ 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.
158
+
159
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
160
+
161
+ 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).
162
+
163
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
164
+
165
+ ```shell
166
+ pip3 install hf_transfer
167
+ ```
168
+
169
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
170
+
171
+ ```shell
172
+ mkdir vigogne-2-70B-chat-GPTQ
173
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/vigogne-2-70B-chat-GPTQ --local-dir vigogne-2-70B-chat-GPTQ --local-dir-use-symlinks False
174
+ ```
175
+
176
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
177
+ </details>
178
+
179
+ ### With `git` (**not** recommended)
180
+
181
+ To clone a specific branch with `git`, use a command like this:
182
+
183
+ ```shell
184
+ git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/vigogne-2-70B-chat-GPTQ
185
+ ```
186
+
187
+ 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.)
188
+
189
+ <!-- README_GPTQ.md-download-from-branches end -->
190
+ <!-- README_GPTQ.md-text-generation-webui start -->
191
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
192
+
193
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
194
+
195
+ 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.
196
+
197
+ 1. Click the **Model tab**.
198
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/vigogne-2-70B-chat-GPTQ`.
199
+
200
+ - To download from a specific branch, enter for example `TheBloke/vigogne-2-70B-chat-GPTQ:gptq-4bit-128g-actorder_True`
201
+ - see Provided Files above for the list of branches for each option.
202
+
203
+ 3. Click **Download**.
204
+ 4. The model will start downloading. Once it's finished it will say "Done".
205
+ 5. In the top left, click the refresh icon next to **Model**.
206
+ 6. In the **Model** dropdown, choose the model you just downloaded: `vigogne-2-70B-chat-GPTQ`
207
+ 7. The model will automatically load, and is now ready for use!
208
+ 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.
209
+
210
+ - 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`.
211
+
212
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
213
+
214
+ <!-- README_GPTQ.md-text-generation-webui end -->
215
+
216
+ <!-- README_GPTQ.md-use-from-tgi start -->
217
+ ## Serving this model from Text Generation Inference (TGI)
218
+
219
+ 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`
220
+
221
+ Example Docker parameters:
222
+
223
+ ```shell
224
+ --model-id TheBloke/vigogne-2-70B-chat-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
225
+ ```
226
+
227
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
228
+
229
+ ```shell
230
+ pip3 install huggingface-hub
231
+ ```
232
+
233
+ ```python
234
+ from huggingface_hub import InferenceClient
235
+
236
+ endpoint_url = "https://your-endpoint-url-here"
237
+
238
+ prompt = "Tell me about AI"
239
+ prompt_template=f'''<s>[INST] <<SYS>>
240
+ Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.
241
+ <</SYS>>
242
+
243
+ {prompt} [/INST]
244
+ '''
245
+
246
+ client = InferenceClient(endpoint_url)
247
+ response = client.text_generation(prompt,
248
+ max_new_tokens=128,
249
+ do_sample=True,
250
+ temperature=0.7,
251
+ top_p=0.95,
252
+ top_k=40,
253
+ repetition_penalty=1.1)
254
+
255
+ print(f"Model output: {response}")
256
+ ```
257
+ <!-- README_GPTQ.md-use-from-tgi end -->
258
+ <!-- README_GPTQ.md-use-from-python start -->
259
+ ## How to use this GPTQ model from Python code
260
+
261
+ ### Install the necessary packages
262
+
263
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
264
+
265
+ ```shell
266
+ pip3 install transformers optimum
267
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
268
+ ```
269
+
270
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
271
+
272
+ ```shell
273
+ pip3 uninstall -y auto-gptq
274
+ git clone https://github.com/PanQiWei/AutoGPTQ
275
+ cd AutoGPTQ
276
+ git checkout v0.4.2
277
+ pip3 install .
278
+ ```
279
+
280
+ ### You can then use the following code
281
+
282
+ ```python
283
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
284
+
285
+ model_name_or_path = "TheBloke/vigogne-2-70B-chat-GPTQ"
286
+ # To use a different branch, change revision
287
+ # For example: revision="gptq-4bit-128g-actorder_True"
288
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
289
+ device_map="auto",
290
+ trust_remote_code=False,
291
+ revision="main")
292
+
293
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
294
+
295
+ prompt = "Tell me about AI"
296
+ prompt_template=f'''<s>[INST] <<SYS>>
297
+ Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.
298
+ <</SYS>>
299
+
300
+ {prompt} [/INST]
301
+ '''
302
+
303
+ print("\n\n*** Generate:")
304
+
305
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
306
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
307
+ print(tokenizer.decode(output[0]))
308
+
309
+ # Inference can also be done using transformers' pipeline
310
+
311
+ print("*** Pipeline:")
312
+ pipe = pipeline(
313
+ "text-generation",
314
+ model=model,
315
+ tokenizer=tokenizer,
316
+ max_new_tokens=512,
317
+ do_sample=True,
318
+ temperature=0.7,
319
+ top_p=0.95,
320
+ top_k=40,
321
+ repetition_penalty=1.1
322
+ )
323
+
324
+ print(pipe(prompt_template)[0]['generated_text'])
325
+ ```
326
+ <!-- README_GPTQ.md-use-from-python end -->
327
+
328
+ <!-- README_GPTQ.md-compatibility start -->
329
+ ## Compatibility
330
+
331
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
332
+
333
+ [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.
334
+
335
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
336
+ <!-- README_GPTQ.md-compatibility end -->
337
+
338
+ <!-- footer start -->
339
+ <!-- 200823 -->
340
+ ## Discord
341
+
342
+ For further support, and discussions on these models and AI in general, join us at:
343
+
344
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
345
+
346
+ ## Thanks, and how to contribute
347
+
348
+ Thanks to the [chirper.ai](https://chirper.ai) team!
349
+
350
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
351
+
352
+ 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.
353
+
354
+ 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.
355
+
356
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
357
+
358
+ * Patreon: https://patreon.com/TheBlokeAI
359
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
360
+
361
+ **Special thanks to**: Aemon Algiz.
362
+
363
+ **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
364
+
365
+
366
+ Thank you to all my generous patrons and donaters!
367
+
368
+ And thank you again to a16z for their generous grant.
369
+
370
+ <!-- footer end -->
371
+
372
+ # Original model card: bofeng huang's Vigogne 2 70B Chat
373
+
374
+
375
+ <p align="center" width="100%">
376
+ <img src="https://huggingface.co/bofenghuang/vigogne-2-70b-chat/resolve/main/logo_v2.jpg" alt="Vigogne" style="width: 30%; min-width: 300px; display: block; margin: auto;">
377
+ </p>
378
+
379
+ # Vigogne-2-70B-Chat: A Llama-2-based French Chat LLM
380
+
381
+ Vigogne-2-70B-Chat is a French chat LLM, based on [Llama-2-70B](https://ai.meta.com/llama), optimized to generate helpful and coherent responses in conversations with users.
382
+
383
+ Check out our [release blog](https://github.com/bofenghuang/vigogne/blob/main/blogs/2023-08-17-vigogne-chat-v2_0.md) and [GitHub repository](https://github.com/bofenghuang/vigogne) for more information.
384
+
385
+ **Usage and License Notices**: Vigogne-2-70B-Chat follows Llama-2's [usage policy](https://ai.meta.com/llama/use-policy). A significant portion of the training data is distilled from GPT-3.5-Turbo and GPT-4, kindly use it cautiously to avoid any violations of OpenAI's [terms of use](https://openai.com/policies/terms-of-use).
386
+
387
+ ## Prompt Template
388
+
389
+ We used a prompt template adapted from the chat format of Llama-2.
390
+
391
+ You can apply this formatting using the [chat template](https://huggingface.co/docs/transformers/main/chat_templating) through the `apply_chat_template()` method.
392
+
393
+ ```python
394
+ from transformers import AutoTokenizer
395
+
396
+ tokenizer = AutoTokenizer.from_pretrained("bofenghuang/vigogne-2-70b-chat")
397
+
398
+ conversation = [
399
+ {"role": "user", "content": "Bonjour ! Comment ça va aujourd'hui ?"},
400
+ {"role": "assistant", "content": "Bonjour ! Je suis une IA, donc je n'ai pas de sentiments, mais je suis prêt à vous aider. Comment puis-je vous assister aujourd'hui ?"},
401
+ {"role": "user", "content": "Quelle est la hauteur de la Tour Eiffel ?"},
402
+ {"role": "assistant", "content": "La Tour Eiffel mesure environ 330 mètres de hauteur."},
403
+ {"role": "user", "content": "Comment monter en haut ?"},
404
+ ]
405
+
406
+ print(tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True))
407
+ ```
408
+
409
+ You will get
410
+
411
+ ```
412
+ <s>[INST] <<SYS>>
413
+ Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.
414
+ <</SYS>>
415
+
416
+ Bonjour ! Comment ça va aujourd'hui ? [/INST] Bonjour ! Je suis une IA, donc je n'ai pas de sentiments, mais je suis prêt à vous aider. Comment puis-je vous assister aujourd'hui ? </s>[INST] Quelle est la hauteur de la Tour Eiffel ? [/INST] La Tour Eiffel mesure environ 330 mètres de hauteur. </s>[INST] Comment monter en haut ? [/INST]
417
+ ```
418
+
419
+ ## Usage
420
+
421
+ <!-- ### Inference using the quantized versions
422
+
423
+ The quantized versions of this model are generously provided by [TheBloke](https://huggingface.co/TheBloke)!
424
+
425
+ - AWQ for GPU inference: [TheBloke/Vigogne-2-70B-Chat-AWQ](https://huggingface.co/TheBloke/Vigogne-2-70B-Chat-AWQ)
426
+ - GTPQ for GPU inference: [TheBloke/Vigogne-2-70B-Chat-GPTQ](https://huggingface.co/TheBloke/Vigogne-2-70B-Chat-GPTQ)
427
+ - GGUF for CPU+GPU inference: [TheBloke/Vigogne-2-70B-Chat-GGUF](https://huggingface.co/TheBloke/Vigogne-2-70B-Chat-GGUF)
428
+
429
+ These versions facilitate testing and development with various popular frameworks, including [AutoAWQ](https://github.com/casper-hansen/AutoAWQ), [vLLM](https://github.com/vllm-project/vllm), [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ), [GPTQ-for-LLaMa](https://github.com/qwopqwop200/GPTQ-for-LLaMa), [llama.cpp](https://github.com/ggerganov/llama.cpp), [text-generation-webui](https://github.com/oobabooga/text-generation-webui), and more. -->
430
+
431
+ ### Inference using the unquantized model with 🤗 Transformers
432
+
433
+ ```python
434
+ from typing import Dict, List, Optional
435
+ import torch
436
+ from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, TextStreamer
437
+
438
+ model_name_or_path = "bofenghuang/vigogne-2-70b-chat"
439
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, padding_side="right", use_fast=False)
440
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path, torch_dtype=torch.float16, device_map="auto")
441
+
442
+ streamer = TextStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
443
+
444
+
445
+ def chat(
446
+ query: str,
447
+ history: Optional[List[Dict]] = None,
448
+ temperature: float = 0.7,
449
+ top_p: float = 1.0,
450
+ top_k: float = 0,
451
+ repetition_penalty: float = 1.1,
452
+ max_new_tokens: int = 1024,
453
+ **kwargs,
454
+ ):
455
+ if history is None:
456
+ history = []
457
+
458
+ history.append({"role": "user", "content": query})
459
+
460
+ input_ids = tokenizer.apply_chat_template(history, return_tensors="pt").to(model.device)
461
+ input_length = input_ids.shape[1]
462
+
463
+ generated_outputs = model.generate(
464
+ input_ids=input_ids,
465
+ generation_config=GenerationConfig(
466
+ temperature=temperature,
467
+ do_sample=temperature > 0.0,
468
+ top_p=top_p,
469
+ top_k=top_k,
470
+ repetition_penalty=repetition_penalty,
471
+ max_new_tokens=max_new_tokens,
472
+ pad_token_id=tokenizer.eos_token_id,
473
+ **kwargs,
474
+ ),
475
+ streamer=streamer,
476
+ return_dict_in_generate=True,
477
+ )
478
+
479
+ generated_tokens = generated_outputs.sequences[0, input_length:]
480
+ generated_text = tokenizer.decode(generated_tokens, skip_special_tokens=True)
481
+
482
+ history.append({"role": "assistant", "content": generated_text})
483
+
484
+ return generated_text, history
485
+
486
+
487
+ # 1st round
488
+ response, history = chat("Un escargot parcourt 100 mètres en 5 heures. Quelle est sa vitesse ?", history=None)
489
+
490
+ # 2nd round
491
+ response, history = chat("Quand il peut dépasser le lapin ?", history=history)
492
+
493
+ # 3rd round
494
+ response, history = chat("Écris une histoire imaginative qui met en scène une compétition de course entre un escargot et un lapin.", history=history)
495
+ ```
496
+
497
+ You can also use the Google Colab Notebook provided below.
498
+
499
+ <a href="https://colab.research.google.com/github/bofenghuang/vigogne/blob/main/notebooks/infer_chat.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
500
+
501
+ ## Limitations
502
+
503
+ Vigogne is still under development, and there are many limitations that have to be addressed. Please note that it is possible that the model generates harmful or biased content, incorrect information or generally unhelpful answers.
504
+
505
+ ## Acknowledgements
506
+
507
+ The model training was conducted on the [Jean-Zay supercomputer](http://www.idris.fr/eng/jean-zay/jean-zay-presentation-eng.html) at GENCI, and we extend our gratitude to the IDRIS team for their responsive support throughout the project.