TheBloke commited on
Commit
87eac03
1 Parent(s): 29212f2

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +498 -0
README.md ADDED
@@ -0,0 +1,498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: LeoLM/leo-hessianai-13b-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 13B 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
+
34
+ <!-- header start -->
35
+ <!-- 200823 -->
36
+ <div style="width: auto; margin-left: auto; margin-right: auto">
37
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
38
+ </div>
39
+ <div style="display: flex; justify-content: space-between; width: 100%;">
40
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
41
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
42
+ </div>
43
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
44
+ <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>
45
+ </div>
46
+ </div>
47
+ <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>
48
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
49
+ <!-- header end -->
50
+
51
+ # Leo Hessianai 13B Chat - GGUF
52
+ - Model creator: [LAION LeoLM](https://huggingface.co/LeoLM)
53
+ - Original model: [Leo Hessianai 13B Chat](https://huggingface.co/LeoLM/leo-hessianai-13b-chat)
54
+
55
+ <!-- description start -->
56
+ ## Description
57
+
58
+ This repo contains GGUF format model files for [LAION LeoLM's Leo Hessianai 13B Chat](https://huggingface.co/LeoLM/leo-hessianai-13b-chat).
59
+
60
+ <!-- description end -->
61
+ <!-- README_GGUF.md-about-gguf start -->
62
+ ### About GGUF
63
+
64
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
65
+
66
+ Here is an incomplate list of clients and libraries that are known to support GGUF:
67
+
68
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
69
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
70
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
71
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration.
72
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
73
+ * [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
74
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
75
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
76
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
77
+
78
+ <!-- README_GGUF.md-about-gguf end -->
79
+ <!-- repositories-available start -->
80
+ ## Repositories available
81
+
82
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-AWQ)
83
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GPTQ)
84
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF)
85
+ * [LAION LeoLM's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/LeoLM/leo-hessianai-13b-chat)
86
+ <!-- repositories-available end -->
87
+
88
+ <!-- prompt-template start -->
89
+ ## Prompt template: ChatML
90
+
91
+ ```
92
+ <|im_start|>system
93
+ {system_message}<|im_end|>
94
+ <|im_start|>user
95
+ {prompt}<|im_end|>
96
+ <|im_start|>assistant
97
+
98
+ ```
99
+
100
+ <!-- prompt-template end -->
101
+
102
+
103
+ <!-- compatibility_gguf start -->
104
+ ## Compatibility
105
+
106
+ These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
107
+
108
+ They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
109
+
110
+ ## Explanation of quantisation methods
111
+ <details>
112
+ <summary>Click to see details</summary>
113
+
114
+ The new methods available are:
115
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
116
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
117
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
118
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
119
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
120
+
121
+ Refer to the Provided Files table below to see what files use which methods, and how.
122
+ </details>
123
+ <!-- compatibility_gguf end -->
124
+
125
+ <!-- README_GGUF.md-provided-files start -->
126
+ ## Provided files
127
+
128
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
129
+ | ---- | ---- | ---- | ---- | ---- | ----- |
130
+ | [leo-hessianai-13b-chat.Q2_K.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q2_K.gguf) | Q2_K | 2 | 5.43 GB| 7.93 GB | smallest, significant quality loss - not recommended for most purposes |
131
+ | [leo-hessianai-13b-chat.Q3_K_S.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q3_K_S.gguf) | Q3_K_S | 3 | 5.66 GB| 8.16 GB | very small, high quality loss |
132
+ | [leo-hessianai-13b-chat.Q3_K_M.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q3_K_M.gguf) | Q3_K_M | 3 | 6.34 GB| 8.84 GB | very small, high quality loss |
133
+ | [leo-hessianai-13b-chat.Q3_K_L.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q3_K_L.gguf) | Q3_K_L | 3 | 6.93 GB| 9.43 GB | small, substantial quality loss |
134
+ | [leo-hessianai-13b-chat.Q4_0.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q4_0.gguf) | Q4_0 | 4 | 7.37 GB| 9.87 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
135
+ | [leo-hessianai-13b-chat.Q4_K_S.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q4_K_S.gguf) | Q4_K_S | 4 | 7.42 GB| 9.92 GB | small, greater quality loss |
136
+ | [leo-hessianai-13b-chat.Q4_K_M.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q4_K_M.gguf) | Q4_K_M | 4 | 7.87 GB| 10.37 GB | medium, balanced quality - recommended |
137
+ | [leo-hessianai-13b-chat.Q5_0.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q5_0.gguf) | Q5_0 | 5 | 8.97 GB| 11.47 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
138
+ | [leo-hessianai-13b-chat.Q5_K_S.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q5_K_S.gguf) | Q5_K_S | 5 | 8.97 GB| 11.47 GB | large, low quality loss - recommended |
139
+ | [leo-hessianai-13b-chat.Q5_K_M.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q5_K_M.gguf) | Q5_K_M | 5 | 9.23 GB| 11.73 GB | large, very low quality loss - recommended |
140
+ | [leo-hessianai-13b-chat.Q6_K.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q6_K.gguf) | Q6_K | 6 | 10.68 GB| 13.18 GB | very large, extremely low quality loss |
141
+ | [leo-hessianai-13b-chat.Q8_0.gguf](https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GGUF/blob/main/leo-hessianai-13b-chat.Q8_0.gguf) | Q8_0 | 8 | 13.83 GB| 16.33 GB | very large, extremely low quality loss - not recommended |
142
+
143
+ **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
144
+
145
+
146
+
147
+ <!-- README_GGUF.md-provided-files end -->
148
+
149
+ <!-- README_GGUF.md-how-to-download start -->
150
+ ## How to download GGUF files
151
+
152
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
153
+
154
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
155
+ - LM Studio
156
+ - LoLLMS Web UI
157
+ - Faraday.dev
158
+
159
+ ### In `text-generation-webui`
160
+
161
+ Under Download Model, you can enter the model repo: TheBloke/leo-hessianai-13B-chat-GGUF and below it, a specific filename to download, such as: leo-hessianai-13b-chat.Q4_K_M.gguf.
162
+
163
+ Then click Download.
164
+
165
+ ### On the command line, including multiple files at once
166
+
167
+ I recommend using the `huggingface-hub` Python library:
168
+
169
+ ```shell
170
+ pip3 install huggingface-hub
171
+ ```
172
+
173
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
174
+
175
+ ```shell
176
+ huggingface-cli download TheBloke/leo-hessianai-13B-chat-GGUF leo-hessianai-13b-chat.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
177
+ ```
178
+
179
+ <details>
180
+ <summary>More advanced huggingface-cli download usage</summary>
181
+
182
+ You can also download multiple files at once with a pattern:
183
+
184
+ ```shell
185
+ huggingface-cli download TheBloke/leo-hessianai-13B-chat-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
186
+ ```
187
+
188
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
189
+
190
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
191
+
192
+ ```shell
193
+ pip3 install hf_transfer
194
+ ```
195
+
196
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
197
+
198
+ ```shell
199
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/leo-hessianai-13B-chat-GGUF leo-hessianai-13b-chat.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
200
+ ```
201
+
202
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
203
+ </details>
204
+ <!-- README_GGUF.md-how-to-download end -->
205
+
206
+ <!-- README_GGUF.md-how-to-run start -->
207
+ ## Example `llama.cpp` command
208
+
209
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
210
+
211
+ ```shell
212
+ ./main -ngl 32 -m leo-hessianai-13b-chat.Q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
213
+ ```
214
+
215
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
216
+
217
+ Change `-c 4096` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically.
218
+
219
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
220
+
221
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
222
+
223
+ ## How to run in `text-generation-webui`
224
+
225
+ Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
226
+
227
+ ## How to run from Python code
228
+
229
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries.
230
+
231
+ ### How to load this model in Python code, using ctransformers
232
+
233
+ #### First install the package
234
+
235
+ Run one of the following commands, according to your system:
236
+
237
+ ```shell
238
+ # Base ctransformers with no GPU acceleration
239
+ pip install ctransformers
240
+ # Or with CUDA GPU acceleration
241
+ pip install ctransformers[cuda]
242
+ # Or with AMD ROCm GPU acceleration (Linux only)
243
+ CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
244
+ # Or with Metal GPU acceleration for macOS systems only
245
+ CT_METAL=1 pip install ctransformers --no-binary ctransformers
246
+ ```
247
+
248
+ #### Simple ctransformers example code
249
+
250
+ ```python
251
+ from ctransformers import AutoModelForCausalLM
252
+
253
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
254
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/leo-hessianai-13B-chat-GGUF", model_file="leo-hessianai-13b-chat.Q4_K_M.gguf", model_type="llama", gpu_layers=50)
255
+
256
+ print(llm("AI is going to"))
257
+ ```
258
+
259
+ ## How to use with LangChain
260
+
261
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
262
+
263
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
264
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
265
+
266
+ <!-- README_GGUF.md-how-to-run end -->
267
+
268
+ <!-- footer start -->
269
+ <!-- 200823 -->
270
+ ## Discord
271
+
272
+ For further support, and discussions on these models and AI in general, join us at:
273
+
274
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
275
+
276
+ ## Thanks, and how to contribute
277
+
278
+ Thanks to the [chirper.ai](https://chirper.ai) team!
279
+
280
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
281
+
282
+ 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.
283
+
284
+ 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.
285
+
286
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
287
+
288
+ * Patreon: https://patreon.com/TheBlokeAI
289
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
290
+
291
+ **Special thanks to**: Aemon Algiz.
292
+
293
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
294
+
295
+
296
+ Thank you to all my generous patrons and donaters!
297
+
298
+ And thank you again to a16z for their generous grant.
299
+
300
+ <!-- footer end -->
301
+
302
+ <!-- original-model-card start -->
303
+ # Original model card: LAION LeoLM's Leo Hessianai 13B Chat
304
+
305
+ # LAION LeoLM: **L**inguistically **E**nhanced **O**pen **L**anguage **M**odel
306
+ Meet LeoLM, the first open and commercially available German Foundation Language Model built on Llama-2.
307
+ Our models extend Llama-2's capabilities into German through continued pretraining on a large corpus of German-language and mostly locality specific text.
308
+ Thanks to a compute grant at HessianAI's new supercomputer **42**, we release two foundation models trained with 8k context length,
309
+ [`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! 👀).
310
+ With this release, we hope to bring a new wave of opportunities to German open-source and commercial LLM research and accelerate adoption.
311
+ Read our [blog post]() or our paper (preprint coming soon) for more details!
312
+
313
+ *A project by Björn Plüster and Christoph Schuhmann in collaboration with LAION and HessianAI.*
314
+
315
+ ## LeoLM Chat
316
+ `LeoLM/leo-hessianai-13b-chat` is a German chat model built on our foundation model `LeoLM/leo-hessianai-13b` and finetuned on a selection of German instruction datasets.
317
+ 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:
318
+ ```
319
+ {
320
+ "first_turn": 6.525,
321
+ "second_turn": 5.15,
322
+ "categories": {
323
+ "writing": 6.925,
324
+ "roleplay": 6.7,
325
+ "reasoning": 4.55,
326
+ "math": 3.25,
327
+ "coding": 3.45,
328
+ "extraction": 5.4,
329
+ "stem": 7.55,
330
+ "humanities": 8.875
331
+ },
332
+ "average": 5.8375
333
+ }
334
+ ```
335
+
336
+ ## Model Details
337
+
338
+ - **Finetuned from:** [LeoLM/leo-hessianai-13b](https://huggingface.co/LeoLM/leo-hessianai-7b)
339
+ - **Model type:** Causal decoder-only transformer language model
340
+ - **Language:** English and German
341
+ - **Demo:** [Web Demo]()
342
+ - **License:** [LLAMA 2 COMMUNITY LICENSE AGREEMENT](https://huggingface.co/meta-llama/Llama-2-70b/raw/main/LICENSE.txt)
343
+ - **Contact:** [LAION Discord](https://discord.com/invite/eq3cAMZtCC) or [Björn Plüster](mailto:bjoern.pl@outlook.de)
344
+
345
+
346
+ ## Use in 🤗Transformers
347
+ First install direct dependencies:
348
+ ```
349
+ pip install transformers torch sentencepiece
350
+ ```
351
+ If you want faster inference using flash-attention2, you need to install these dependencies:
352
+ ```bash
353
+ pip install packaging ninja
354
+ pip install flash-attn==v2.1.1 --no-build-isolation
355
+ pip install git+https://github.com/HazyResearch/flash-attention.git@v2.1.1#subdirectory=csrc/rotary
356
+ ```
357
+ Then load the model in transformers:
358
+ ```python
359
+ from transformers import pipeline
360
+ import torch
361
+
362
+ system_prompt = """<|im_start|>system
363
+ Dies ist eine Unterhaltung zwischen einem intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
364
+ Der Assistent gibt ausführliche, hilfreiche und ehrliche Antworten.<|im_end|>
365
+
366
+ """
367
+ prompt_format = "<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
368
+ prompt = "Erkläre mir wie die Fahrradwegesituation in Hamburg ist."
369
+
370
+ generator = pipeline(model="LeoLM/leo-hessianai-13b-chat", device="cuda", torch_dtype=torch.float16, trust_remote_code=True) # True for flash-attn2 else False
371
+ print(generator(prompt_format.format(prompt=prompt), do_sample=True, top_p=0.95, max_length=8192))
372
+ ```
373
+
374
+ "*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.*"
375
+
376
+ ## Prompting / Prompt Template
377
+
378
+ Prompt dialogue template (ChatML format):
379
+
380
+ ```
381
+ """
382
+ <|im_start|>system
383
+ {system_message}<|im_end|>
384
+ <|im_start|>user
385
+ {prompt}<|im_end|>
386
+ <|im_start|>assistant
387
+ """
388
+ ```
389
+
390
+ The model input can contain multiple conversation turns between user and assistant, e.g.
391
+ ```
392
+ <|im_start|>user
393
+ {prompt 1}<|im_end|>
394
+ <|im_start|>assistant
395
+ {reply 1}<|im_end|>
396
+ <|im_start|>user
397
+ {prompt 2}<|im_end|>
398
+ <|im_start|>assistant
399
+ (...)
400
+ ```
401
+
402
+ ## Ethical Considerations and Limitations
403
+
404
+ LeoLM has been tested in English and German, and has not covered, nor could it cover all scenarios.
405
+ For these reasons, as with all LLMs, the potential outputs of `LeoLM/leo-hessianai-13b-chat` cannot be predicted
406
+ in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
407
+ to user prompts. Therefore, before deploying any applications of `LeoLM/leo-hessianai-13b-chat`, developers should
408
+ perform safety testing and tuning tailored to their specific applications of the model.
409
+
410
+ Please see Meta's [Responsible Use Guide](https://ai.meta.com/llama/responsible-use-guide/).
411
+
412
+ ## Finetuning Details
413
+
414
+ | Hyperparameter | Value |
415
+ |---|---|
416
+ | Num epochs | 3 |
417
+ | Examples per epoch | 131214 |
418
+ | Global batch size | 256 |
419
+ | Learning rate | 3e-5 |
420
+ | Warmup steps | 100 |
421
+ | LR scheduler | Cosine |
422
+ | Adam betas | (0.9, 0.95) |
423
+
424
+
425
+ ## Dataset Details
426
+ ```
427
+ ## Stats for 'Subset of OpenAssistant/OASST-DE' (3534 samples (100.0%))
428
+ -----------------
429
+ Accepted: 3534/3534 (100.0%)
430
+ Accepted tokens: 2259302
431
+ Skipped: 0 (0.0%)
432
+ Min tokens per sample: 29
433
+ Max tokens per sample: 2484
434
+ Avg tokens per sample: 639.3044708545557
435
+ -----------------
436
+
437
+ ## Stats for 'Subset of FreedomIntelligence/evol-instruct-deutsch' (57841 samples (100.0%))
438
+ -----------------
439
+ Accepted: 57841/57841 (100.0%)
440
+ Accepted tokens: 42958192
441
+ Skipped: 0 (0.0%)
442
+ Min tokens per sample: 33
443
+ Max tokens per sample: 5507
444
+ Avg tokens per sample: 742.6944900675991
445
+ -----------------
446
+
447
+ ## Stats for 'Subset of FreedomIntelligence/alpaca-gpt4-deutsch' (48969 samples (100.0%))
448
+ -----------------
449
+ Accepted: 48969/48969 (100.0%)
450
+ Accepted tokens: 13372005
451
+ Skipped: 0 (0.0%)
452
+ Min tokens per sample: 19
453
+ Max tokens per sample: 1359
454
+ Avg tokens per sample: 273.07082031489307
455
+ -----------------
456
+
457
+ ## Stats for 'Subset of LeoLM/OpenSchnabeltier' (21314 samples (100.0%))
458
+ -----------------
459
+ Accepted: 21314/21314 (100.0%)
460
+ Accepted tokens: 8134690
461
+ Skipped: 0 (0.0%)
462
+ Min tokens per sample: 25
463
+ Max tokens per sample: 1202
464
+ Avg tokens per sample: 381.65947264708643
465
+ -----------------
466
+
467
+ ## Stats for 'Subset of LeoLM/German_Poems' (490 samples (100.0%))
468
+ -----------------
469
+ Accepted: 490/490 (100.0%)
470
+ Accepted tokens: 618642
471
+ Skipped: 0 (0.0%)
472
+ Min tokens per sample: 747
473
+ Max tokens per sample: 1678
474
+ Avg tokens per sample: 1262.534693877551
475
+ -----------------
476
+
477
+ ## Stats for 'Subset of LeoLM/German_Songs' (392 samples (100.0%))
478
+ -----------------
479
+ Accepted: 392/392 (100.0%)
480
+ Accepted tokens: 187897
481
+ Skipped: 0 (0.0%)
482
+ Min tokens per sample: 231
483
+ Max tokens per sample: 826
484
+ Avg tokens per sample: 479.3290816326531
485
+ -----------------
486
+
487
+ ## Stats for 'total' (132540 samples (100.0%))
488
+ -----------------
489
+ Accepted: 132540/132540 (100.0%)
490
+ Accepted tokens: 67530728
491
+ Skipped: 0 (0.0%)
492
+ Min tokens per sample: 19
493
+ Max tokens per sample: 5507
494
+ Avg tokens per sample: 509.51205673758864
495
+ -----------------
496
+ ```
497
+
498
+ <!-- original-model-card end -->