Text Generation
Transformers
Safetensors
English
German
llama
conversational
text-generation-inference
4-bit precision
gptq
TheBloke commited on
Commit
327065f
1 Parent(s): 592a12e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +585 -0
README.md ADDED
@@ -0,0 +1,585 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: LeoLM/leo-hessianai-70b-chat
3
+ datasets:
4
+ - LeoLM/OpenSchnabeltier
5
+ - OpenAssistant/OASST-DE
6
+ - FreedomIntelligence/alpaca-gpt4-deutsch
7
+ - FreedomIntelligence/evol-instruct-deutsch
8
+ - LeoLM/German_Poems
9
+ - LeoLM/German_Songs
10
+ inference: false
11
+ language:
12
+ - en
13
+ - de
14
+ library_name: transformers
15
+ license: llama2
16
+ model_creator: LAION LeoLM
17
+ model_name: Leo Hessianai 70B Chat
18
+ model_type: llama
19
+ pipeline_tag: text-generation
20
+ prompt_template: '<|im_start|>system
21
+
22
+ {system_message}<|im_end|>
23
+
24
+ <|im_start|>user
25
+
26
+ {prompt}<|im_end|>
27
+
28
+ <|im_start|>assistant
29
+
30
+ '
31
+ quantized_by: TheBloke
32
+ ---
33
+ <!-- markdownlint-disable MD041 -->
34
+
35
+ <!-- header start -->
36
+ <!-- 200823 -->
37
+ <div style="width: auto; margin-left: auto; margin-right: auto">
38
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
39
+ </div>
40
+ <div style="display: flex; justify-content: space-between; width: 100%;">
41
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
42
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
43
+ </div>
44
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
45
+ <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>
46
+ </div>
47
+ </div>
48
+ <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>
49
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
50
+ <!-- header end -->
51
+
52
+ # Leo Hessianai 70B Chat - GPTQ
53
+ - Model creator: [LAION LeoLM](https://huggingface.co/LeoLM)
54
+ - Original model: [Leo Hessianai 70B Chat](https://huggingface.co/LeoLM/leo-hessianai-70b-chat)
55
+
56
+ <!-- description start -->
57
+ # Description
58
+
59
+ This repo contains GPTQ model files for [LAION LeoLM's Leo Hessianai 70B Chat](https://huggingface.co/LeoLM/leo-hessianai-70b-chat).
60
+
61
+ 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.
62
+
63
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
64
+
65
+ <!-- description end -->
66
+ <!-- repositories-available start -->
67
+ ## Repositories available
68
+
69
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-AWQ)
70
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ)
71
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GGUF)
72
+ * [LAION LeoLM's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/LeoLM/leo-hessianai-70b-chat)
73
+ <!-- repositories-available end -->
74
+
75
+ <!-- prompt-template start -->
76
+ ## Prompt template: ChatML
77
+
78
+ ```
79
+ <|im_start|>system
80
+ {system_message}<|im_end|>
81
+ <|im_start|>user
82
+ {prompt}<|im_end|>
83
+ <|im_start|>assistant
84
+
85
+ ```
86
+
87
+ <!-- prompt-template end -->
88
+
89
+
90
+
91
+ <!-- README_GPTQ.md-compatible clients start -->
92
+ ## Known compatible clients / servers
93
+
94
+ GPTQ models are currently supported on Linux (NVidia/AMD) and Windows (NVidia only). macOS users: please use GGUF models.
95
+
96
+ These GPTQ models are known to work in the following inference servers/webuis.
97
+
98
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
99
+ - [KoboldAI United](https://github.com/henk717/koboldai)
100
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
101
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
102
+
103
+ This may not be a complete list; if you know of others, please let me know!
104
+ <!-- README_GPTQ.md-compatible clients end -->
105
+
106
+ <!-- README_GPTQ.md-provided-files start -->
107
+ ## Provided files, and GPTQ parameters
108
+
109
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
110
+
111
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
112
+
113
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
114
+
115
+ <details>
116
+ <summary>Explanation of GPTQ parameters</summary>
117
+
118
+ - Bits: The bit size of the quantised model.
119
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
120
+ - 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.
121
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
122
+ - 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).
123
+ - 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.
124
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
125
+
126
+ </details>
127
+
128
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
129
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
130
+ | [main](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 8192 | 35.34 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
131
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 8192 | 36.66 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
132
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 8192 | 40.67 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
133
+ | [gptq-3bit--1g-actorder_True](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ/tree/gptq-3bit--1g-actorder_True) | 3 | None | Yes | 0.1 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 8192 | 26.78 GB | No | 3-bit, with Act Order and no group size. Lowest possible VRAM requirements. May be lower quality than 3-bit 128g. |
134
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 8192 | 28.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
135
+ | [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 8192 | 31.84 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
136
+
137
+ <!-- README_GPTQ.md-provided-files end -->
138
+
139
+ <!-- README_GPTQ.md-download-from-branches start -->
140
+ ## How to download, including from branches
141
+
142
+ ### In text-generation-webui
143
+
144
+ To download from the `main` branch, enter `TheBloke/leo-hessianai-70B-chat-GPTQ` in the "Download model" box.
145
+
146
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/leo-hessianai-70B-chat-GPTQ:gptq-4bit-128g-actorder_True`
147
+
148
+ ### From the command line
149
+
150
+ I recommend using the `huggingface-hub` Python library:
151
+
152
+ ```shell
153
+ pip3 install huggingface-hub
154
+ ```
155
+
156
+ To download the `main` branch to a folder called `leo-hessianai-70B-chat-GPTQ`:
157
+
158
+ ```shell
159
+ mkdir leo-hessianai-70B-chat-GPTQ
160
+ huggingface-cli download TheBloke/leo-hessianai-70B-chat-GPTQ --local-dir leo-hessianai-70B-chat-GPTQ --local-dir-use-symlinks False
161
+ ```
162
+
163
+ To download from a different branch, add the `--revision` parameter:
164
+
165
+ ```shell
166
+ mkdir leo-hessianai-70B-chat-GPTQ
167
+ huggingface-cli download TheBloke/leo-hessianai-70B-chat-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir leo-hessianai-70B-chat-GPTQ --local-dir-use-symlinks False
168
+ ```
169
+
170
+ <details>
171
+ <summary>More advanced huggingface-cli download usage</summary>
172
+
173
+ 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.
174
+
175
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
176
+
177
+ 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).
178
+
179
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
180
+
181
+ ```shell
182
+ pip3 install hf_transfer
183
+ ```
184
+
185
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
186
+
187
+ ```shell
188
+ mkdir leo-hessianai-70B-chat-GPTQ
189
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/leo-hessianai-70B-chat-GPTQ --local-dir leo-hessianai-70B-chat-GPTQ --local-dir-use-symlinks False
190
+ ```
191
+
192
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
193
+ </details>
194
+
195
+ ### With `git` (**not** recommended)
196
+
197
+ To clone a specific branch with `git`, use a command like this:
198
+
199
+ ```shell
200
+ git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/leo-hessianai-70B-chat-GPTQ
201
+ ```
202
+
203
+ 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.)
204
+
205
+ <!-- README_GPTQ.md-download-from-branches end -->
206
+ <!-- README_GPTQ.md-text-generation-webui start -->
207
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
208
+
209
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
210
+
211
+ 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.
212
+
213
+ 1. Click the **Model tab**.
214
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/leo-hessianai-70B-chat-GPTQ`.
215
+
216
+ - To download from a specific branch, enter for example `TheBloke/leo-hessianai-70B-chat-GPTQ:gptq-4bit-128g-actorder_True`
217
+ - see Provided Files above for the list of branches for each option.
218
+
219
+ 3. Click **Download**.
220
+ 4. The model will start downloading. Once it's finished it will say "Done".
221
+ 5. In the top left, click the refresh icon next to **Model**.
222
+ 6. In the **Model** dropdown, choose the model you just downloaded: `leo-hessianai-70B-chat-GPTQ`
223
+ 7. The model will automatically load, and is now ready for use!
224
+ 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.
225
+
226
+ - 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`.
227
+
228
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
229
+
230
+ <!-- README_GPTQ.md-text-generation-webui end -->
231
+
232
+ <!-- README_GPTQ.md-use-from-tgi start -->
233
+ ## Serving this model from Text Generation Inference (TGI)
234
+
235
+ 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`
236
+
237
+ Example Docker parameters:
238
+
239
+ ```shell
240
+ --model-id TheBloke/leo-hessianai-70B-chat-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
241
+ ```
242
+
243
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
244
+
245
+ ```shell
246
+ pip3 install huggingface-hub
247
+ ```
248
+
249
+ ```python
250
+ from huggingface_hub import InferenceClient
251
+
252
+ endpoint_url = "https://your-endpoint-url-here"
253
+
254
+ prompt = "Tell me about AI"
255
+ prompt_template=f'''<|im_start|>system
256
+ {system_message}<|im_end|>
257
+ <|im_start|>user
258
+ {prompt}<|im_end|>
259
+ <|im_start|>assistant
260
+ '''
261
+
262
+ client = InferenceClient(endpoint_url)
263
+ response = client.text_generation(prompt,
264
+ max_new_tokens=128,
265
+ do_sample=True,
266
+ temperature=0.7,
267
+ top_p=0.95,
268
+ top_k=40,
269
+ repetition_penalty=1.1)
270
+
271
+ print(f"Model output: {response}")
272
+ ```
273
+ <!-- README_GPTQ.md-use-from-tgi end -->
274
+ <!-- README_GPTQ.md-use-from-python start -->
275
+ ## Python code example: inference from this GPTQ model
276
+
277
+ ### Install the necessary packages
278
+
279
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
280
+
281
+ ```shell
282
+ pip3 install --upgrade transformers optimum
283
+ # If using PyTorch 2.1 + CUDA 12.x:
284
+ pip3 install --upgrade auto-gptq
285
+ # or, if using PyTorch 2.1 + CUDA 11.x:
286
+ pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
287
+ ```
288
+
289
+ If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
290
+
291
+ ```shell
292
+ pip3 uninstall -y auto-gptq
293
+ git clone https://github.com/PanQiWei/AutoGPTQ
294
+ cd AutoGPTQ
295
+ git checkout v0.5.1
296
+ pip3 install .
297
+ ```
298
+
299
+ ### Example Python code
300
+
301
+ ```python
302
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
303
+
304
+ model_name_or_path = "TheBloke/leo-hessianai-70B-chat-GPTQ"
305
+ # To use a different branch, change revision
306
+ # For example: revision="gptq-4bit-128g-actorder_True"
307
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
308
+ device_map="auto",
309
+ trust_remote_code=False,
310
+ revision="main")
311
+
312
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
313
+
314
+ prompt = "Tell me about AI"
315
+ prompt_template=f'''<|im_start|>system
316
+ {system_message}<|im_end|>
317
+ <|im_start|>user
318
+ {prompt}<|im_end|>
319
+ <|im_start|>assistant
320
+ '''
321
+
322
+ print("\n\n*** Generate:")
323
+
324
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
325
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
326
+ print(tokenizer.decode(output[0]))
327
+
328
+ # Inference can also be done using transformers' pipeline
329
+
330
+ print("*** Pipeline:")
331
+ pipe = pipeline(
332
+ "text-generation",
333
+ model=model,
334
+ tokenizer=tokenizer,
335
+ max_new_tokens=512,
336
+ do_sample=True,
337
+ temperature=0.7,
338
+ top_p=0.95,
339
+ top_k=40,
340
+ repetition_penalty=1.1
341
+ )
342
+
343
+ print(pipe(prompt_template)[0]['generated_text'])
344
+ ```
345
+ <!-- README_GPTQ.md-use-from-python end -->
346
+
347
+ <!-- README_GPTQ.md-compatibility start -->
348
+ ## Compatibility
349
+
350
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
351
+
352
+ [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.
353
+
354
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
355
+ <!-- README_GPTQ.md-compatibility end -->
356
+
357
+ <!-- footer start -->
358
+ <!-- 200823 -->
359
+ ## Discord
360
+
361
+ For further support, and discussions on these models and AI in general, join us at:
362
+
363
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
364
+
365
+ ## Thanks, and how to contribute
366
+
367
+ Thanks to the [chirper.ai](https://chirper.ai) team!
368
+
369
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
370
+
371
+ 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.
372
+
373
+ 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.
374
+
375
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
376
+
377
+ * Patreon: https://patreon.com/TheBlokeAI
378
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
379
+
380
+ **Special thanks to**: Aemon Algiz.
381
+
382
+ **Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros
383
+
384
+
385
+ Thank you to all my generous patrons and donaters!
386
+
387
+ And thank you again to a16z for their generous grant.
388
+
389
+ <!-- footer end -->
390
+
391
+ # Original model card: LAION LeoLM's Leo Hessianai 70B Chat
392
+
393
+ # LAION LeoLM 70b Chat: **L**inguistically **E**nhanced **O**pen **L**anguage **M**odel
394
+ Meet LeoLM, the first open and commercially available German Foundation Language Model built on Llama-2.
395
+ Our models extend Llama-2's capabilities into German through continued pretraining on a large corpus of German-language and mostly locality specific text.
396
+ Thanks to a compute grant at HessianAI's new supercomputer **42**, we release a series foundation models trained with 8k context length
397
+ under the [Llama-2 community license](https://huggingface.co/meta-llama/Llama-2-70b/raw/main/LICENSE.txt). Now, we're finally releasing the
398
+ much anticipated `leo-hessianai-70b`, the largest model of this series based on `Llama-2-70b`.
399
+ With this release, we hope to bring a new wave of opportunities to German open-source and commercial LLM research and accelerate adoption.
400
+ Read our [blog post](https://laion.ai/blog/leo-lm/) or our paper (preprint coming soon) for more details!
401
+
402
+
403
+ *A project by Björn Plüster and Christoph Schuhmann in collaboration with LAION and HessianAI.*
404
+
405
+ ## LeoLM Chat
406
+ `LeoLM/leo-hessianai-70b-chat` is a German chat model built on our foundation model `LeoLM/leo-hessianai-70b` and finetuned on a selection of German instruction datasets.
407
+ The model performs exceptionally well on writing, explanation and discussion tasks but struggles somewhat with math and advanced reasoning. See our MT-Bench-DE scores:
408
+ ```
409
+ {
410
+ "first_turn": 7.2375,
411
+ "second_turn": 6.5375,
412
+ "categories": {
413
+ "writing": 8.55,
414
+ "roleplay": 7.15,
415
+ "reasoning": 4.2,
416
+ "math": 4.85,
417
+ "coding": 4.85,
418
+ "extraction": 7.75,
419
+ "stem": 8.45,
420
+ "humanities": 9.3
421
+ },
422
+ "average": 6.8875
423
+ }
424
+ ```
425
+ Have a look at some examples [in this Google Doc](https://docs.google.com/document/d/1SAAikkPAF4oLoFISqE0P1mRL5OUk8l2pI90zZC4bP1E/edit?usp=sharing).
426
+
427
+
428
+ ## Model Details
429
+
430
+ - **Finetuned from:** [LeoLM/leo-hessianai-70b](https://huggingface.co/LeoLM/leo-hessianai-70b)
431
+ - **Model type:** Causal decoder-only transformer language model
432
+ - **Language:** English and German
433
+ - **Demo:** [Web Demo]()
434
+ - **License:** [LLAMA 2 COMMUNITY LICENSE AGREEMENT](https://huggingface.co/meta-llama/Llama-2-70b/raw/main/LICENSE.txt)
435
+ - **Contact:** [LAION Discord](https://discord.com/invite/eq3cAMZtCC) or [Björn Plüster](mailto:bjoern.pl@outlook.de)
436
+
437
+
438
+ ## Use in 🤗Transformers
439
+ First install direct dependencies:
440
+ ```
441
+ pip install transformers torch
442
+ ```
443
+ Then load the model in transformers:
444
+ ```python
445
+ from transformers import pipeline
446
+ import torch
447
+
448
+ system_prompt = """<|im_start|>system
449
+ Dies ist eine Unterhaltung zwischen einem intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
450
+ Der Assistent gibt ausführliche, hilfreiche und ehrliche Antworten.<|im_end|>
451
+
452
+ """
453
+ prompt_format = "<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
454
+ prompt = "Erkläre mir wie die Fahrradwegesituation in Hamburg ist."
455
+
456
+ generator = pipeline(model="LeoLM/leo-hessianai-70b-chat", device="cuda", torch_dtype=torch.float16)
457
+ print(generator(prompt_format.format(prompt=prompt), do_sample=True, top_p=0.95, max_length=8192))
458
+ ```
459
+
460
+ "*Hamburg verfügt über ein umfangreiches Netzwerk an Radwegen, das ein effizientes und angenehmes Radfahren in der ganzen Stadt ermöglicht. Die Radwege variieren in Bezug auf ihre Qualität, wobei einige erstklassig mit eigens für Radfahrer reservierten Spuren sind, während andere einfache Fahrradsymbole auf dem Boden haben, die anzeigen, dass Radfahrer abwechselnd mit dem Autoverkehr auf der Straße fahren sollten. Einige Nebenstraßen haben auch spezielle Fahrradspuren, wobei einige mit Bordsteinabsenkungen zur Seite der Autospuren markiert sind. Zusätzlich haben viele Hauptstraßen, insbesondere in Nebenstraßen, fahrradfreundliche Abstände zwischen den geparkten Autos und dem Gehweg, was ein bequemes Fahren auf der Straße ermöglicht. Der Bau von Radschnellwegen, die schnelles und effizientes Radfahren in und aus der Stadt ermöglichen, ist im Gange und wird in den kommenden Jahren fortgesetzt. Insgesamt sind die Radwege in Hamburg weitläufig und gut ausgeschildert, was es zu einem angenehmen Ort macht, um mit dem Fahrrad zu fahren.*"
461
+
462
+ ## Prompting / Prompt Template
463
+
464
+ Prompt dialogue template (ChatML format):
465
+
466
+ ```
467
+ """
468
+ <|im_start|>system
469
+ {system_message}<|im_end|>
470
+ <|im_start|>user
471
+ {prompt}<|im_end|>
472
+ <|im_start|>assistant
473
+ """
474
+ ```
475
+
476
+ The model input can contain multiple conversation turns between user and assistant, e.g.
477
+ ```
478
+ <|im_start|>user
479
+ {prompt 1}<|im_end|>
480
+ <|im_start|>assistant
481
+ {reply 1}<|im_end|>
482
+ <|im_start|>user
483
+ {prompt 2}<|im_end|>
484
+ <|im_start|>assistant
485
+ (...)
486
+ ```
487
+
488
+ ## Ethical Considerations and Limitations
489
+
490
+ LeoLM has been tested in English and German, and has not covered, nor could it cover all scenarios.
491
+ For these reasons, as with all LLMs, the potential outputs of `LeoLM/leo-hessianai-70b-chat` cannot be predicted
492
+ in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
493
+ to user prompts. Therefore, before deploying any applications of `LeoLM/leo-hessianai-70b-chat`, developers should
494
+ perform safety testing and tuning tailored to their specific applications of the model.
495
+
496
+ We are aware of the model refusing to answer more often than desired. This will be adressed in future versions. For now, the training
497
+ dataset is equal to that used for our smaller chat variants.
498
+
499
+ Please see Meta's [Responsible Use Guide](https://ai.meta.com/llama/responsible-use-guide/).
500
+
501
+ ## Finetuning Details
502
+
503
+ | Hyperparameter | Value |
504
+ |---|---|
505
+ | Num epochs | 3 |
506
+ | Examples per epoch | 131214 |
507
+ | Global batch size | 256 |
508
+ | Learning rate | 1.5e-5 |
509
+ | Warmup steps | 15 |
510
+ | LR scheduler | Cosine |
511
+ | Adam betas | (0.9, 0.95) |
512
+ | Weight Decay | 0.01 |
513
+
514
+ ## Dataset Details
515
+ ```
516
+ ## Stats for 'Subset of OpenAssistant/OASST-DE' (3534 samples (100.0%))
517
+ -----------------
518
+ Accepted: 3534/3534 (100.0%)
519
+ Accepted tokens: 2259302
520
+ Skipped: 0 (0.0%)
521
+ Min tokens per sample: 29
522
+ Max tokens per sample: 2484
523
+ Avg tokens per sample: 639.3044708545557
524
+ -----------------
525
+
526
+ ## Stats for 'Subset of FreedomIntelligence/evol-instruct-deutsch' (57841 samples (100.0%))
527
+ -----------------
528
+ Accepted: 57841/57841 (100.0%)
529
+ Accepted tokens: 42958192
530
+ Skipped: 0 (0.0%)
531
+ Min tokens per sample: 33
532
+ Max tokens per sample: 5507
533
+ Avg tokens per sample: 742.6944900675991
534
+ -----------------
535
+
536
+ ## Stats for 'Subset of FreedomIntelligence/alpaca-gpt4-deutsch' (48969 samples (100.0%))
537
+ -----------------
538
+ Accepted: 48969/48969 (100.0%)
539
+ Accepted tokens: 13372005
540
+ Skipped: 0 (0.0%)
541
+ Min tokens per sample: 19
542
+ Max tokens per sample: 1359
543
+ Avg tokens per sample: 273.07082031489307
544
+ -----------------
545
+
546
+ ## Stats for 'Subset of LeoLM/OpenSchnabeltier' (21314 samples (100.0%))
547
+ -----------------
548
+ Accepted: 21314/21314 (100.0%)
549
+ Accepted tokens: 8134690
550
+ Skipped: 0 (0.0%)
551
+ Min tokens per sample: 25
552
+ Max tokens per sample: 1202
553
+ Avg tokens per sample: 381.65947264708643
554
+ -----------------
555
+
556
+ ## Stats for 'Subset of LeoLM/German_Poems' (490 samples (100.0%))
557
+ -----------------
558
+ Accepted: 490/490 (100.0%)
559
+ Accepted tokens: 618642
560
+ Skipped: 0 (0.0%)
561
+ Min tokens per sample: 747
562
+ Max tokens per sample: 1678
563
+ Avg tokens per sample: 1262.534693877551
564
+ -----------------
565
+
566
+ ## Stats for 'Subset of LeoLM/German_Songs' (392 samples (100.0%))
567
+ -----------------
568
+ Accepted: 392/392 (100.0%)
569
+ Accepted tokens: 187897
570
+ Skipped: 0 (0.0%)
571
+ Min tokens per sample: 231
572
+ Max tokens per sample: 826
573
+ Avg tokens per sample: 479.3290816326531
574
+ -----------------
575
+
576
+ ## Stats for 'total' (132540 samples (100.0%))
577
+ -----------------
578
+ Accepted: 132540/132540 (100.0%)
579
+ Accepted tokens: 67530728
580
+ Skipped: 0 (0.0%)
581
+ Min tokens per sample: 19
582
+ Max tokens per sample: 5507
583
+ Avg tokens per sample: 509.51205673758864
584
+ -----------------
585
+ ```