TheBloke commited on
Commit
98c7bc9
1 Parent(s): ed0e6e8

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +537 -0
README.md ADDED
@@ -0,0 +1,537 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: LeoLM/leo-mistral-hessianai-7b-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: apache-2.0
16
+ model_creator: LAION LeoLM
17
+ model_name: Leo Mistral Hessianai 7B Chat
18
+ model_type: mistral
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 Mistral Hessianai 7B Chat - AWQ
53
+ - Model creator: [LAION LeoLM](https://huggingface.co/LeoLM)
54
+ - Original model: [Leo Mistral Hessianai 7B Chat](https://huggingface.co/LeoLM/leo-mistral-hessianai-7b-chat)
55
+
56
+ <!-- description start -->
57
+ ## Description
58
+
59
+ This repo contains AWQ model files for [LAION LeoLM's Leo Mistral Hessianai 7B Chat](https://huggingface.co/LeoLM/leo-mistral-hessianai-7b-chat).
60
+
61
+
62
+ ### About AWQ
63
+
64
+ 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.
65
+
66
+ It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
67
+
68
+ As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
69
+
70
+ Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI with unquantised models, however using AWQ enables using much smaller GPUs which can lead to easier deployment and overall cost savings. For example, a 70B model can be run on 1 x 48GB GPU instead of 2 x 80GB.
71
+ <!-- description end -->
72
+ <!-- repositories-available start -->
73
+ ## Repositories available
74
+
75
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ)
76
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GPTQ)
77
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF)
78
+ * [LAION LeoLM's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/LeoLM/leo-mistral-hessianai-7b-chat)
79
+ <!-- repositories-available end -->
80
+
81
+ <!-- prompt-template start -->
82
+ ## Prompt template: ChatML
83
+
84
+ ```
85
+ <|im_start|>system
86
+ {system_message}<|im_end|>
87
+ <|im_start|>user
88
+ {prompt}<|im_end|>
89
+ <|im_start|>assistant
90
+
91
+ ```
92
+
93
+ <!-- prompt-template end -->
94
+
95
+
96
+ <!-- README_AWQ.md-provided-files start -->
97
+ ## Provided files, and AWQ parameters
98
+
99
+ For my first release of AWQ models, I am releasing 128g models only. I will consider adding 32g as well if there is interest, and once I have done perplexity and evaluation comparisons, but at this time 32g models are still not fully tested with AutoAWQ and vLLM.
100
+
101
+ Models are released as sharded safetensors files.
102
+
103
+ | Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
104
+ | ------ | ---- | -- | ----------- | ------- | ---- |
105
+ | [main](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ/tree/main) | 4 | 128 | [German Quad](https://huggingface.co/datasets/deepset/germanquad) | 4096 | 4.15 GB
106
+
107
+ <!-- README_AWQ.md-provided-files end -->
108
+
109
+ <!-- README_AWQ.md-text-generation-webui start -->
110
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
111
+
112
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
113
+
114
+ 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.
115
+
116
+ 1. Click the **Model tab**.
117
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ`.
118
+ 3. Click **Download**.
119
+ 4. The model will start downloading. Once it's finished it will say "Done".
120
+ 5. In the top left, click the refresh icon next to **Model**.
121
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Leo-Mistral-Hessianai-7B-Chat-AWQ`
122
+ 7. Select **Loader: AutoAWQ**.
123
+ 8. Click Load, and the model will load and is now ready for use.
124
+ 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.
125
+ 10. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
126
+ <!-- README_AWQ.md-text-generation-webui end -->
127
+
128
+ <!-- README_AWQ.md-use-from-vllm start -->
129
+ ## Serving this model from vLLM
130
+
131
+ Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
132
+
133
+ - Please ensure you are using vLLM version 0.2 or later.
134
+ - When using vLLM as a server, pass the `--quantization awq` parameter.
135
+ - At the time of writing, vLLM AWQ does not support loading models in bfloat16, so to ensure compatibility with all models, also pass `--dtype float16`.
136
+
137
+ For example:
138
+
139
+ ```shell
140
+ python3 python -m vllm.entrypoints.api_server --model TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ --quantization awq --dtype float16
141
+ ```
142
+
143
+ - When using vLLM from Python code, again pass the `quantization=awq` and `dtype=float16` parameters.
144
+
145
+ For example:
146
+
147
+ ```python
148
+ from vllm import LLM, SamplingParams
149
+
150
+ prompts = [
151
+ "Hello, my name is",
152
+ "The president of the United States is",
153
+ "The capital of France is",
154
+ "The future of AI is",
155
+ ]
156
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
157
+
158
+ llm = LLM(model="TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ", quantization="awq", dtype="float16")
159
+
160
+ outputs = llm.generate(prompts, sampling_params)
161
+
162
+ # Print the outputs.
163
+ for output in outputs:
164
+ prompt = output.prompt
165
+ generated_text = output.outputs[0].text
166
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
167
+ ```
168
+ <!-- README_AWQ.md-use-from-vllm start -->
169
+
170
+ <!-- README_AWQ.md-use-from-tgi start -->
171
+ ## Serving this model from Text Generation Inference (TGI)
172
+
173
+ Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
174
+
175
+ Example Docker parameters:
176
+
177
+ ```shell
178
+ --model-id TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
179
+ ```
180
+
181
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
182
+
183
+ ```shell
184
+ pip3 install huggingface-hub
185
+ ```
186
+
187
+ ```python
188
+ from huggingface_hub import InferenceClient
189
+
190
+ endpoint_url = "https://your-endpoint-url-here"
191
+
192
+ prompt = "Tell me about AI"
193
+ prompt_template=f'''<|im_start|>system
194
+ {system_message}<|im_end|>
195
+ <|im_start|>user
196
+ {prompt}<|im_end|>
197
+ <|im_start|>assistant
198
+
199
+ '''
200
+
201
+ client = InferenceClient(endpoint_url)
202
+ response = client.text_generation(prompt,
203
+ max_new_tokens=128,
204
+ do_sample=True,
205
+ temperature=0.7,
206
+ top_p=0.95,
207
+ top_k=40,
208
+ repetition_penalty=1.1)
209
+
210
+ print(f"Model output: {response}")
211
+ ```
212
+ <!-- README_AWQ.md-use-from-tgi end -->
213
+
214
+ <!-- README_AWQ.md-use-from-python start -->
215
+ ## How to use this AWQ model from Python code
216
+
217
+ ### Install the necessary packages
218
+
219
+ Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later
220
+
221
+ ```shell
222
+ pip3 install autoawq
223
+ ```
224
+
225
+ If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
226
+
227
+ ```shell
228
+ pip3 uninstall -y autoawq
229
+ git clone https://github.com/casper-hansen/AutoAWQ
230
+ cd AutoAWQ
231
+ pip3 install .
232
+ ```
233
+
234
+ ### You can then try the following example code
235
+
236
+ ```python
237
+ from awq import AutoAWQForCausalLM
238
+ from transformers import AutoTokenizer
239
+
240
+ model_name_or_path = "TheBloke/Leo-Mistral-Hessianai-7B-Chat-AWQ"
241
+
242
+ # Load model
243
+ model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
244
+ trust_remote_code=False, safetensors=True)
245
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
246
+
247
+ prompt = "Tell me about AI"
248
+ prompt_template=f'''<|im_start|>system
249
+ {system_message}<|im_end|>
250
+ <|im_start|>user
251
+ {prompt}<|im_end|>
252
+ <|im_start|>assistant
253
+ '''
254
+
255
+ print("\n\n*** Generate:")
256
+
257
+ tokens = tokenizer(
258
+ prompt_template,
259
+ return_tensors='pt'
260
+ ).input_ids.cuda()
261
+
262
+ # Generate output
263
+ generation_output = model.generate(
264
+ tokens,
265
+ do_sample=True,
266
+ temperature=0.7,
267
+ top_p=0.95,
268
+ top_k=40,
269
+ max_new_tokens=512
270
+ )
271
+
272
+ print("Output: ", tokenizer.decode(generation_output[0]))
273
+
274
+ """
275
+ # Inference should be possible with transformers pipeline as well in future
276
+ # But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
277
+ from transformers import pipeline
278
+
279
+ print("*** Pipeline:")
280
+ pipe = pipeline(
281
+ "text-generation",
282
+ model=model,
283
+ tokenizer=tokenizer,
284
+ max_new_tokens=512,
285
+ do_sample=True,
286
+ temperature=0.7,
287
+ top_p=0.95,
288
+ top_k=40,
289
+ repetition_penalty=1.1
290
+ )
291
+
292
+ print(pipe(prompt_template)[0]['generated_text'])
293
+ """
294
+ ```
295
+ <!-- README_AWQ.md-use-from-python end -->
296
+
297
+ <!-- README_AWQ.md-compatibility start -->
298
+ ## Compatibility
299
+
300
+ The files provided are tested to work with:
301
+
302
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui) using `Loader: AutoAWQ`
303
+ - [vLLM](https://github.com/vllm-project/vllm)
304
+ - [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
305
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
306
+
307
+ <!-- README_AWQ.md-compatibility end -->
308
+
309
+ <!-- footer start -->
310
+ <!-- 200823 -->
311
+ ## Discord
312
+
313
+ For further support, and discussions on these models and AI in general, join us at:
314
+
315
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
316
+
317
+ ## Thanks, and how to contribute
318
+
319
+ Thanks to the [chirper.ai](https://chirper.ai) team!
320
+
321
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
322
+
323
+ 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.
324
+
325
+ 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.
326
+
327
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
328
+
329
+ * Patreon: https://patreon.com/TheBlokeAI
330
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
331
+
332
+ **Special thanks to**: Aemon Algiz.
333
+
334
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
335
+
336
+
337
+ Thank you to all my generous patrons and donaters!
338
+
339
+ And thank you again to a16z for their generous grant.
340
+
341
+ <!-- footer end -->
342
+
343
+ # Original model card: LAION LeoLM's Leo Mistral Hessianai 7B Chat
344
+
345
+ # LAION LeoLM: **L**inguistically **E**nhanced **O**pen **L**anguage **M**odel
346
+ Meet LeoLM, the first open and commercially available German Foundation Language Model built on Llama-2 and Mistral.
347
+ Our models extend Llama-2's capabilities into German through continued pretraining on a large corpus of German-language and mostly locality specific text.
348
+ Thanks to a compute grant at HessianAI's new supercomputer **42**, we release three foundation models trained with 8k context length.
349
+ [`LeoLM/leo-mistral-hessianai-7b`](https://huggingface.co/LeoLM/leo-mistral-hessianai-7b) under Apache 2.0 and [`LeoLM/leo-hessianai-7b`](https://huggingface.co/LeoLM/leo-hessianai-7b) and [`LeoLM/leo-hessianai-13b`](https://huggingface.co/LeoLM/leo-hessianai-13b) under the [Llama-2 community license](https://huggingface.co/meta-llama/Llama-2-70b/raw/main/LICENSE.txt) (70b also coming soon! 👀).
350
+ With this release, we hope to bring a new wave of opportunities to German open-source and commercial LLM research and accelerate adoption.
351
+ Read our [blog post](https://laion.ai/blog/leo-lm/) or our paper (preprint coming soon) for more details!
352
+
353
+ *A project by Björn Plüster and Christoph Schuhmann in collaboration with LAION and HessianAI.*
354
+
355
+ ## LeoLM Chat
356
+ `LeoLM/leo-mistral-hessianai-7b-chat` is a German chat model built on our foundation model `LeoLM/leo-mistral-hessianai-7b` and finetuned on a selection of German instruction datasets.
357
+ 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:
358
+ ```
359
+ {
360
+ "first_turn": 6.1,
361
+ "second_turn": 4.7,
362
+ "categories": {
363
+ "writing": 6.8,
364
+ "roleplay": 6.35,
365
+ "reasoning": 3.3,
366
+ "math": 2.75,
367
+ "coding": 4.4,
368
+ "extraction": 4.5,
369
+ "stem": 6.85,
370
+ "humanities": 8.25
371
+ },
372
+ "average": 5.4
373
+ }
374
+ ```
375
+
376
+ ## Model Details
377
+
378
+ - **Finetuned from:** [LeoLM/leo-mistral-hessianai-7b](https://huggingface.co/LeoLM/leo-hessianai-7b)
379
+ - **Model type:** Causal decoder-only transformer language model
380
+ - **Language:** English and German
381
+ - **Demo:** [Web Demo coming soon !]()
382
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)
383
+ - **Contact:** [LAION Discord](https://discord.com/invite/eq3cAMZtCC) or [Björn Plüster](mailto:[email protected])
384
+
385
+
386
+ ## Use in 🤗Transformers
387
+ First install direct dependencies:
388
+ ```
389
+ pip install transformers torch sentencepiece
390
+ ```
391
+ If you want faster inference using flash-attention2, you need to install these dependencies:
392
+ ```bash
393
+ pip install packaging ninja
394
+ pip install flash-attn
395
+ ```
396
+ Then load the model in transformers:
397
+ ```python
398
+ from transformers import pipeline
399
+ import torch
400
+
401
+ system_prompt = """<|im_start|>system
402
+ Dies ist eine Unterhaltung zwischen einem intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
403
+ Der Assistent gibt ausführliche, hilfreiche und ehrliche Antworten.<|im_end|>
404
+
405
+ """
406
+ prompt_format = "<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
407
+ prompt = "Erkläre mir wie die Fahrradwegesituation in Hamburg ist."
408
+
409
+ generator = pipeline(model="LeoLM/leo-mistral-hessianai-7b-chat", device="cuda", torch_dtype=torch.float16, use_flash_attention_2=True) # True for flash-attn2 else False
410
+ print(generator(prompt_format.format(prompt=prompt), do_sample=True, top_p=0.95, max_length=8192))
411
+ ```
412
+
413
+ "*Als KI kann ich keine persönlichen Beobachtungen teilen, aber ich kann einige allgemeine Informationen zur Fahrradwegesituation in Hamburg liefern. Im Vergleich zu vielen anderen großen Städten hat Hamburg eine hohe Anzahl von Fahrradfahrern und nimmt seine Verantwortung für nachhaltige Verkehrsmittel sehr ernst. Es gibt viele Fahrradwege und separate Fahrspuren, die Radfahrern ermöglichen, zusammen mit dem Autoverkehr zu fahren. Diese Fahrradspuren sind oft mit Markierungen gekennzeichnet und durch physische Trennungen von anderen Fahrspuren abgegrenzt. Darüber hinaus gibt es viele Fahrradstraßen, auf denen Radfahrer Vorfahrt haben und Autos langsamer fahren müssen.*
414
+
415
+ *In einigen städtischen Gebieten können Fahrradwege jedoch eng oder überfüllt sein, besonders während der Stoßzeiten. Es gibt auch viele Kreuzungen, an denen Radfahrer anhalten und auf Grün warten müssen, ähnlich wie Autofahrer. Insgesamt ist die Fahrradinfrastruktur in Hamburg ziemlich gut, aber wie überall gibt es immer Raum für Verbesserungen.*"
416
+
417
+ ## Prompting / Prompt Template
418
+
419
+ Prompt dialogue template (ChatML format):
420
+
421
+ ```
422
+ """
423
+ <|im_start|>system
424
+ {system_message}<|im_end|>
425
+ <|im_start|>user
426
+ {prompt}<|im_end|>
427
+ <|im_start|>assistant
428
+ """
429
+ ```
430
+
431
+ The model input can contain multiple conversation turns between user and assistant, e.g.
432
+ ```
433
+ <|im_start|>user
434
+ {prompt 1}<|im_end|>
435
+ <|im_start|>assistant
436
+ {reply 1}<|im_end|>
437
+ <|im_start|>user
438
+ {prompt 2}<|im_end|>
439
+ <|im_start|>assistant
440
+ (...)
441
+ ```
442
+
443
+ ## Ethical Considerations and Limitations
444
+
445
+ LeoLM has been tested in English and German, and has not covered, nor could it cover all scenarios.
446
+ For these reasons, as with all LLMs, the potential outputs of `LeoLM/leo-mistral-hessianai-7b-chat` cannot be predicted
447
+ in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
448
+ to user prompts. Therefore, before deploying any applications of `LeoLM/leo-mistral-hessianai-7b-chat`, developers should
449
+ perform safety testing and tuning tailored to their specific applications of the model.
450
+
451
+ Please see Meta's [Responsible Use Guide](https://ai.meta.com/llama/responsible-use-guide/).
452
+
453
+ ## Finetuning Details
454
+
455
+ | Hyperparameter | Value |
456
+ |---|---|
457
+ | Num epochs | 4 |
458
+ | Examples per epoch | 131214 |
459
+ | Global batch size | 256 |
460
+ | Learning rate | 1e-5 |
461
+ | Warmup steps | 100 |
462
+ | LR scheduler | Cosine |
463
+ | Adam betas | (0.9, 0.95) |
464
+
465
+
466
+ ## Dataset Details
467
+ ```
468
+ ## Stats for 'Subset of OpenAssistant/OASST-DE' (3534 samples (100.0%))
469
+ -----------------
470
+ Accepted: 3534/3534 (100.0%)
471
+ Accepted tokens: 2259302
472
+ Skipped: 0 (0.0%)
473
+ Min tokens per sample: 29
474
+ Max tokens per sample: 2484
475
+ Avg tokens per sample: 639.3044708545557
476
+ -----------------
477
+
478
+ ## Stats for 'Subset of FreedomIntelligence/evol-instruct-deutsch' (57841 samples (100.0%))
479
+ -----------------
480
+ Accepted: 57841/57841 (100.0%)
481
+ Accepted tokens: 42958192
482
+ Skipped: 0 (0.0%)
483
+ Min tokens per sample: 33
484
+ Max tokens per sample: 5507
485
+ Avg tokens per sample: 742.6944900675991
486
+ -----------------
487
+
488
+ ## Stats for 'Subset of FreedomIntelligence/alpaca-gpt4-deutsch' (48969 samples (100.0%))
489
+ -----------------
490
+ Accepted: 48969/48969 (100.0%)
491
+ Accepted tokens: 13372005
492
+ Skipped: 0 (0.0%)
493
+ Min tokens per sample: 19
494
+ Max tokens per sample: 1359
495
+ Avg tokens per sample: 273.07082031489307
496
+ -----------------
497
+
498
+ ## Stats for 'Subset of LeoLM/OpenSchnabeltier' (21314 samples (100.0%))
499
+ -----------------
500
+ Accepted: 21314/21314 (100.0%)
501
+ Accepted tokens: 8134690
502
+ Skipped: 0 (0.0%)
503
+ Min tokens per sample: 25
504
+ Max tokens per sample: 1202
505
+ Avg tokens per sample: 381.65947264708643
506
+ -----------------
507
+
508
+ ## Stats for 'Subset of LeoLM/German_Poems' (490 samples (100.0%))
509
+ -----------------
510
+ Accepted: 490/490 (100.0%)
511
+ Accepted tokens: 618642
512
+ Skipped: 0 (0.0%)
513
+ Min tokens per sample: 747
514
+ Max tokens per sample: 1678
515
+ Avg tokens per sample: 1262.534693877551
516
+ -----------------
517
+
518
+ ## Stats for 'Subset of LeoLM/German_Songs' (392 samples (100.0%))
519
+ -----------------
520
+ Accepted: 392/392 (100.0%)
521
+ Accepted tokens: 187897
522
+ Skipped: 0 (0.0%)
523
+ Min tokens per sample: 231
524
+ Max tokens per sample: 826
525
+ Avg tokens per sample: 479.3290816326531
526
+ -----------------
527
+
528
+ ## Stats for 'total' (132540 samples (100.0%))
529
+ -----------------
530
+ Accepted: 132540/132540 (100.0%)
531
+ Accepted tokens: 67530728
532
+ Skipped: 0 (0.0%)
533
+ Min tokens per sample: 19
534
+ Max tokens per sample: 5507
535
+ Avg tokens per sample: 509.51205673758864
536
+ -----------------
537
+ ```