TheBloke commited on
Commit
74abf55
·
verified ·
1 Parent(s): 6408fa8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +575 -0
README.md ADDED
@@ -0,0 +1,575 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: DiscoResearch/DiscoLM_German_7b_v1
3
+ inference: false
4
+ language:
5
+ - de
6
+ - en
7
+ license: apache-2.0
8
+ model-index:
9
+ - name: DiscoLM_German_7b_v1
10
+ results: []
11
+ model_creator: Disco Research
12
+ model_name: DiscoLM German 7B v1
13
+ model_type: mistral
14
+ prompt_template: '<|im_start|>system
15
+
16
+ {system_message}<|im_end|>
17
+
18
+ <|im_start|>user
19
+
20
+ {prompt}<|im_end|>
21
+
22
+ <|im_start|>assistant
23
+
24
+ '
25
+ quantized_by: TheBloke
26
+ tags:
27
+ - Mistral
28
+ - finetune
29
+ - chatml
30
+ - DPO
31
+ - German
32
+ - Deutsch
33
+ - synthetic data
34
+ ---
35
+ <!-- markdownlint-disable MD041 -->
36
+
37
+ <!-- header start -->
38
+ <!-- 200823 -->
39
+ <div style="width: auto; margin-left: auto; margin-right: auto">
40
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
41
+ </div>
42
+ <div style="display: flex; justify-content: space-between; width: 100%;">
43
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
44
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
45
+ </div>
46
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
47
+ <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>
48
+ </div>
49
+ </div>
50
+ <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>
51
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
52
+ <!-- header end -->
53
+
54
+ # DiscoLM German 7B v1 - AWQ
55
+ - Model creator: [Disco Research](https://huggingface.co/DiscoResearch)
56
+ - Original model: [DiscoLM German 7B v1](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1)
57
+
58
+ <!-- description start -->
59
+ ## Description
60
+
61
+ This repo contains AWQ model files for [Disco Research's DiscoLM German 7B v1](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1).
62
+
63
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
64
+
65
+
66
+ ### About AWQ
67
+
68
+ 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.
69
+
70
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
71
+
72
+ It is supported by:
73
+
74
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
75
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
76
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
77
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
78
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
79
+
80
+ <!-- description end -->
81
+ <!-- repositories-available start -->
82
+ ## Repositories available
83
+
84
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-AWQ)
85
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-GPTQ)
86
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-GGUF)
87
+ * [Disco Research's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1)
88
+ <!-- repositories-available end -->
89
+
90
+ <!-- prompt-template start -->
91
+ ## Prompt template: ChatML
92
+
93
+ ```
94
+ <|im_start|>system
95
+ {system_message}<|im_end|>
96
+ <|im_start|>user
97
+ {prompt}<|im_end|>
98
+ <|im_start|>assistant
99
+
100
+ ```
101
+
102
+ <!-- prompt-template end -->
103
+
104
+
105
+ <!-- README_AWQ.md-provided-files start -->
106
+ ## Provided files, and AWQ parameters
107
+
108
+ I currently release 128g GEMM models only. The addition of group_size 32 models, and GEMV kernel models, is being actively considered.
109
+
110
+ Models are released as sharded safetensors files.
111
+
112
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
113
+ | ------ | ---- | -- | ----------- | ------- | ---- |
114
+ | [main](https://huggingface.co/TheBloke/DiscoLM_German_7b_v1-AWQ/tree/main) | 4 | 128 | [German Quad](https://huggingface.co/datasets/deepset/germanquad/viewer/) | 4096 | 4.15 GB
115
+
116
+ <!-- README_AWQ.md-provided-files end -->
117
+
118
+ <!-- README_AWQ.md-text-generation-webui start -->
119
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
120
+
121
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
122
+
123
+ 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.
124
+
125
+ 1. Click the **Model tab**.
126
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/DiscoLM_German_7b_v1-AWQ`.
127
+ 3. Click **Download**.
128
+ 4. The model will start downloading. Once it's finished it will say "Done".
129
+ 5. In the top left, click the refresh icon next to **Model**.
130
+ 6. In the **Model** dropdown, choose the model you just downloaded: `DiscoLM_German_7b_v1-AWQ`
131
+ 7. Select **Loader: AutoAWQ**.
132
+ 8. Click Load, and the model will load and is now ready for use.
133
+ 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.
134
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
135
+ <!-- README_AWQ.md-text-generation-webui end -->
136
+
137
+ <!-- README_AWQ.md-use-from-vllm start -->
138
+ ## Multi-user inference server: vLLM
139
+
140
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
141
+
142
+ - Please ensure you are using vLLM version 0.2 or later.
143
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
144
+
145
+ For example:
146
+
147
+ ```shell
148
+ python3 -m vllm.entrypoints.api_server --model TheBloke/DiscoLM_German_7b_v1-AWQ --quantization awq --dtype auto
149
+ ```
150
+
151
+ - When using vLLM from Python code, again set `quantization=awq`.
152
+
153
+ For example:
154
+
155
+ ```python
156
+ from vllm import LLM, SamplingParams
157
+
158
+ prompts = [
159
+ "Tell me about AI",
160
+ "Write a story about llamas",
161
+ "What is 291 - 150?",
162
+ "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
163
+ ]
164
+ prompt_template=f'''<|im_start|>system
165
+ {system_message}<|im_end|>
166
+ <|im_start|>user
167
+ {prompt}<|im_end|>
168
+ <|im_start|>assistant
169
+ '''
170
+
171
+ prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
172
+
173
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
174
+
175
+ llm = LLM(model="TheBloke/DiscoLM_German_7b_v1-AWQ", quantization="awq", dtype="auto")
176
+
177
+ outputs = llm.generate(prompts, sampling_params)
178
+
179
+ # Print the outputs.
180
+ for output in outputs:
181
+ prompt = output.prompt
182
+ generated_text = output.outputs[0].text
183
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
184
+ ```
185
+ <!-- README_AWQ.md-use-from-vllm start -->
186
+
187
+ <!-- README_AWQ.md-use-from-tgi start -->
188
+ ## Multi-user inference server: Hugging Face Text Generation Inference (TGI)
189
+
190
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
191
+
192
+ Example Docker parameters:
193
+
194
+ ```shell
195
+ --model-id TheBloke/DiscoLM_German_7b_v1-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
196
+ ```
197
+
198
+ Example Python code for interfacing with TGI (requires [huggingface-hub](https://github.com/huggingface/huggingface_hub) 0.17.0 or later):
199
+
200
+ ```shell
201
+ pip3 install huggingface-hub
202
+ ```
203
+
204
+ ```python
205
+ from huggingface_hub import InferenceClient
206
+
207
+ endpoint_url = "https://your-endpoint-url-here"
208
+
209
+ prompt = "Tell me about AI"
210
+ prompt_template=f'''<|im_start|>system
211
+ {system_message}<|im_end|>
212
+ <|im_start|>user
213
+ {prompt}<|im_end|>
214
+ <|im_start|>assistant
215
+ '''
216
+
217
+ client = InferenceClient(endpoint_url)
218
+ response = client.text_generation(prompt,
219
+ max_new_tokens=128,
220
+ do_sample=True,
221
+ temperature=0.7,
222
+ top_p=0.95,
223
+ top_k=40,
224
+ repetition_penalty=1.1)
225
+
226
+ print(f"Model output: ", response)
227
+ ```
228
+ <!-- README_AWQ.md-use-from-tgi end -->
229
+
230
+ <!-- README_AWQ.md-use-from-python start -->
231
+ ## Inference from Python code using Transformers
232
+
233
+ ### Install the necessary packages
234
+
235
+ - Requires: [Transformers](https://huggingface.co/docs/transformers) 4.35.0 or later.
236
+ - Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.6 or later.
237
+
238
+ ```shell
239
+ pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
240
+ ```
241
+
242
+ Note that if you are using PyTorch 2.0.1, the above AutoAWQ command will automatically upgrade you to PyTorch 2.1.0.
243
+
244
+ If you are using CUDA 11.8 and wish to continue using PyTorch 2.0.1, instead run this command:
245
+
246
+ ```shell
247
+ pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
248
+ ```
249
+
250
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
251
+
252
+ ```shell
253
+ pip3 uninstall -y autoawq
254
+ git clone https://github.com/casper-hansen/AutoAWQ
255
+ cd AutoAWQ
256
+ pip3 install .
257
+ ```
258
+
259
+ ### Transformers example code (requires Transformers 4.35.0 and later)
260
+
261
+ ```python
262
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
263
+
264
+ model_name_or_path = "TheBloke/DiscoLM_German_7b_v1-AWQ"
265
+
266
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
267
+ model = AutoModelForCausalLM.from_pretrained(
268
+ model_name_or_path,
269
+ low_cpu_mem_usage=True,
270
+ device_map="cuda:0"
271
+ )
272
+
273
+ # Using the text streamer to stream output one token at a time
274
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
275
+
276
+ prompt = "Tell me about AI"
277
+ prompt_template=f'''<|im_start|>system
278
+ {system_message}<|im_end|>
279
+ <|im_start|>user
280
+ {prompt}<|im_end|>
281
+ <|im_start|>assistant
282
+ '''
283
+
284
+ # Convert prompt to tokens
285
+ tokens = tokenizer(
286
+ prompt_template,
287
+ return_tensors='pt'
288
+ ).input_ids.cuda()
289
+
290
+ generation_params = {
291
+ "do_sample": True,
292
+ "temperature": 0.7,
293
+ "top_p": 0.95,
294
+ "top_k": 40,
295
+ "max_new_tokens": 512,
296
+ "repetition_penalty": 1.1
297
+ }
298
+
299
+ # Generate streamed output, visible one token at a time
300
+ generation_output = model.generate(
301
+ tokens,
302
+ streamer=streamer,
303
+ **generation_params
304
+ )
305
+
306
+ # Generation without a streamer, which will include the prompt in the output
307
+ generation_output = model.generate(
308
+ tokens,
309
+ **generation_params
310
+ )
311
+
312
+ # Get the tokens from the output, decode them, print them
313
+ token_output = generation_output[0]
314
+ text_output = tokenizer.decode(token_output)
315
+ print("model.generate output: ", text_output)
316
+
317
+ # Inference is also possible via Transformers' pipeline
318
+ from transformers import pipeline
319
+
320
+ pipe = pipeline(
321
+ "text-generation",
322
+ model=model,
323
+ tokenizer=tokenizer,
324
+ **generation_params
325
+ )
326
+
327
+ pipe_output = pipe(prompt_template)[0]['generated_text']
328
+ print("pipeline output: ", pipe_output)
329
+
330
+ ```
331
+ <!-- README_AWQ.md-use-from-python end -->
332
+
333
+ <!-- README_AWQ.md-compatibility start -->
334
+ ## Compatibility
335
+
336
+ The files provided are tested to work with:
337
+
338
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`.
339
+ - [vLLM](https://github.com/vllm-project/vllm) version 0.2.0 and later.
340
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) version 1.1.0 and later.
341
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later.
342
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) version 0.1.1 and later.
343
+
344
+ <!-- README_AWQ.md-compatibility end -->
345
+
346
+ <!-- footer start -->
347
+ <!-- 200823 -->
348
+ ## Discord
349
+
350
+ For further support, and discussions on these models and AI in general, join us at:
351
+
352
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
353
+
354
+ ## Thanks, and how to contribute
355
+
356
+ Thanks to the [chirper.ai](https://chirper.ai) team!
357
+
358
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
359
+
360
+ 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.
361
+
362
+ 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.
363
+
364
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
365
+
366
+ * Patreon: https://patreon.com/TheBlokeAI
367
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
368
+
369
+ **Special thanks to**: Aemon Algiz.
370
+
371
+ **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
372
+
373
+
374
+ Thank you to all my generous patrons and donaters!
375
+
376
+ And thank you again to a16z for their generous grant.
377
+
378
+ <!-- footer end -->
379
+
380
+ # Original model card: Disco Research's DiscoLM German 7B v1
381
+
382
+
383
+ # DiscoLM German 7b v1
384
+
385
+ ![DiscoLM_Logo](discolm_german.png)
386
+
387
+ ## Table of Contents
388
+
389
+ 1. [Introduction](#introduction)
390
+ 2. [Demo](#demo)
391
+ 3. [Downloads](#Downloads)
392
+ 4. [Prompt Format](#prompt-format)
393
+ 5. [Results](#results)
394
+ 6. [Evaluation](#evaluation)
395
+ 7. [Dataset](#dataset)
396
+ 8. [Limitations & Biases](#limitations--biases)
397
+ 9. [Acknowledgements](#acknowledgements)
398
+ 10. [About DiscoResearch](#about-discoresearch)
399
+ 11. [Disclaimer](#disclaimer)
400
+
401
+ # Introduction
402
+
403
+ **DiscoLM German 7b** is a Mistral-based large language model with a focus on German-language applications and the successor of the [EM German](https://huggingface.co/jphme/em_german_leo_mistral) model family.
404
+ It was trained on a large dataset of instructions in German and English with a SFT finetuning phase followed by additional DPO reinforcement learning.
405
+ The model is optimized for German text, providing proficiency in understanding, generating, and interacting with German language content while preserving its fluency in English and excelling at translation tasks.
406
+
407
+ Our goal with Disco LM German was not to beat benchmarks, but to provide a robust and reliable model for everyday use that can serve as a drop-in replacement for ChatGPT and other proprietary models.
408
+ We find that the perceived quality of it´s German-language output is even higher than GPT-4 in many cases; however it won't compete with larger models and top English 7b models for very complex reasoning, math or coding tasks.
409
+
410
+ # Demo
411
+
412
+ Please find a Demo and try the model at [demo.discoresearch.org](https://demo.discoresearch.org/) (in case the Demo is down and you have questions, you can contact us on our [Discord](https://discord.gg/ttNdas89f3)).
413
+
414
+ # Downloads
415
+
416
+ ## Model Links
417
+
418
+ We will update the links as soon as the quants are available on HuggingFace.
419
+
420
+ | Base Model | HF | GPTQ | GGUF | AWQ |
421
+ |-------|-------|-------|-------|-------|
422
+ | DiscoLM German 7b v1 | [Link](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1) | soon | soon | soon |
423
+
424
+
425
+ # Prompt Format
426
+
427
+ DiscoLM German uses ChatML as the prompt format which enables OpenAI endpoint compatability and is supported by most inference libraries and frontends.
428
+
429
+ System prompts allow steerability and interesting new ways to interact with an LLM, guiding rules, roles, and stylistic choices of the model.
430
+
431
+ ```
432
+ <|im_start|>system
433
+ Du bist ein hilfreicher Assistent.<|im_end|>
434
+ <|im_start|>user
435
+ Wer bist du?<|im_end|>
436
+ <|im_start|>assistant
437
+ Ich bin ein Sprachmodell namens DiscoLM German und ich wurde von DiscoResearch trainiert.<|im_end|>
438
+ ```
439
+
440
+ This prompt is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating), which means you can format messages using the
441
+ `tokenizer.apply_chat_template()` method:
442
+
443
+ ```python
444
+ messages = [
445
+ {"role": "system", "content": "Du bist ein hilfreicher Assistent."},
446
+ {"role": "user", "content": "Wer bist du?"}
447
+ ]
448
+ gen_input = tokenizer.apply_chat_template(message, return_tensors="pt")
449
+ model.generate(**gen_input)
450
+ ```
451
+
452
+ When tokenizing messages for generation, set `add_generation_prompt=True` when calling `apply_chat_template()`. This will append `<|im_start|>assistant\n` to your prompt, to ensure
453
+ that the model continues with an assistant response.
454
+
455
+ ## Retrieval Format
456
+
457
+ You can use a special retrieval format to improve steerability and reduce hallucinations for RAG applications (but other, more default formats should also work, this is purely optional)
458
+
459
+ Example:
460
+
461
+ ```
462
+ ### System:
463
+
464
+ Du bist ein hilfreicher Assistent. Für die folgende Aufgabe stehen dir zwischen den Tags BEGININPUT und ENDINPUT mehrere Quellen zur Verfügung. Metadaten zu den einzelnen Quellen wie Autor, URL o.ä. sind zwischen BEGINCONTEXT und ENDCONTEXT zu finden, danach folgt der Text der Quelle. Die eigentliche Aufgabe oder Frage ist zwischen BEGININSTRUCTION und ENDINSTRUCTION zu finden. Beantworte diese ausschließlich mit Informationen aus den gegebenen Quellen und gebe die Information zur genutzten Quelle unter "Quelle:" an. Sollten die Quellen keine relevanten Informationen enthalten, antworte: "Mit den gegebenen Informationen ist diese Frage nicht zu beantworten."
465
+
466
+ ### User Prompt:
467
+
468
+ BEGININPUT
469
+ BEGINCONTEXT
470
+ url: https://this.is.fake.news
471
+ time: 2089-09-01
472
+ ENDCONTEXT
473
+ Buxtehude ist die größte Stadt Deutschlands mit 96.56 Millionen Einwohnern.
474
+ ENDINPUT
475
+
476
+ BEGININSTRUCTION
477
+ Was ist die größte deutsche Stadt?
478
+ ENDINSTRUCTION
479
+
480
+ ### Model Answer:
481
+
482
+ Die größte deutsche Stadt ist Buxtehude.
483
+
484
+ Quelle:
485
+ url: https://this.is.fake.news
486
+ time: 2089-09-01
487
+
488
+ ```
489
+
490
+ ## Function Calling
491
+
492
+ The model also supports structured outputs/function calling, albeit this is a very experimental feature and YMMV.
493
+ This will be improved in the future.
494
+
495
+ The model will prefix functioncalls with `<functioncall>` and you can provide results in response with `<functionresponse>` for Multi-Turn applications.
496
+
497
+ Example:
498
+
499
+ ```
500
+ ### System:
501
+
502
+ Du bist ein hilfreicher Assistent. Extrahiere alle Personen aus den Eingaben des Users.
503
+
504
+ Du hast Zugriff auf folgende Funktionen:
505
+
506
+ {'name': 'PersonList',
507
+ 'description': 'Extrahiere die Namen aller im Text vorkommenden Personen',
508
+ 'parameters': {'$defs': {'Person': {'description': 'Details über eine person',
509
+ 'properties': {'name': {'title': 'Name', 'type': 'string'},
510
+ 'job': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Job'},
511
+ 'age': {'anyOf': [{'type': 'integer'}, {'type': 'null'}],
512
+ 'title': 'Age'}},
513
+ 'required': ['name', 'job', 'age'],
514
+ 'title': 'Person',
515
+ 'type': 'object'}},
516
+ 'properties': {'person_list': {'items': {'$ref': '#/$defs/Person'},
517
+ 'title': 'Person List',
518
+ 'type': 'array'}},
519
+ 'required': ['person_list'],
520
+ 'type': 'object'}}
521
+
522
+ ### User Prompt:
523
+
524
+ Björn (25) und Jan sind die Gründer von ellamind.
525
+
526
+ ### Model Answer:
527
+
528
+ <functioncall> {"name": "PersonList", "arguments": '{"person_list": ["{"name": "Björn", "job": "founder", "age": 25}, {"name": "Jan", "job": "founder", "age": null}]}'}
529
+
530
+ ```
531
+
532
+
533
+ # Results
534
+
535
+ -to follow -
536
+
537
+ # Evaluation
538
+
539
+ As written above, we believe that current benchmarks don't capture the full spectrum of LLM capabilities very well. We didn't look at any benchmark results (besides training losses) until the work on DiscoLM was finished and didn't include any data resembling common benchmark formats in our training data.
540
+
541
+ That said, preliminary results with a German version of MT Bench show promising results: While lacking for coding and extraxtion tasks, DiscoLM German 7b performs not far below GPT-3.5-turbo on many tasks and even singificantly outperforms it in the reasoning category.
542
+
543
+ ![MTBench_DE_Results](mtbench_de_discolm_german_7b.png)
544
+
545
+ Additional Benchmark results will follow. The biggest strength of this model (language quality as perceived by native speakers) can't yet be captured in a benchmark - please let us know if you have an idea how to change this!
546
+
547
+ # Dataset
548
+
549
+ The dataset is a mixture of multi-turn chats, retrieval instructions and synthetically generated instructions spawning many topics and applications.
550
+
551
+
552
+ # Limitations & Biases
553
+
554
+ This model can produce factually incorrect and offensive output, and should not be relied on to produce factually accurate information.
555
+ This model was trained on various public datasets. While great efforts have been taken to clean the pretraining data, it is possible that this model could generate biased or otherwise offensive outputs and it is the responsibility of the user to implement a safety/moderation layer. Please use with caution.
556
+
557
+ # Acknowledgements
558
+
559
+ DiscoLM German is a [DiscoResearch](https://huggingface.co/DiscoResearch) project led by [JP Harries](https://huggingface.co/jphme) and supported by [Björn Plüster](https://huggingface.co/bjoernp) and [Daniel Auras](https://huggingface.co/rasdani).
560
+
561
+ We thank [HessianAI](https://hessian.ai/) for providing compute & support for various DiscoResearch projects and our friends at [LAION](https://laion.ai) for their work on LeoLM and scientific adivce.**
562
+
563
+ Development of DiscoLM German 7b was sponsored by **[ellamind](https://ellamind.com)**, where some of our founders are working on creating customized models for business applications with a focus on non-english language applications. Please get in contact if you need customized models for your business!
564
+
565
+
566
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
567
+
568
+ # About DiscoResearch
569
+
570
+ DiscoResearch is an aspiring open research community for AI enthusiasts and LLM hackers. Come join our [Discord](https://discord.gg/ttNdas89f3), share your opinions and ideas, and advance open LLM research with us!
571
+
572
+
573
+ # Disclaimer
574
+
575
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. This model should only be deployed with additional safety measures in place.