Text Generation
Transformers
GGUF
English
German
llama
text-generation-inference
TheBloke commited on
Commit
21e17ae
1 Parent(s): e425dbf

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +535 -0
README.md ADDED
@@ -0,0 +1,535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: LeoLM/leo-hessianai-7b-chat-bilingual
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
+ - garage-bAInd/Open-Platypus
11
+ - WizardLM/WizardLM_evol_instruct_70k
12
+ - bjoernp/oasst25-08-23-filtered
13
+ inference: false
14
+ language:
15
+ - en
16
+ - de
17
+ library_name: transformers
18
+ license: llama2
19
+ model_creator: LAION LeoLM
20
+ model_name: Leo Hessianai 7B Chat Bilingual
21
+ model_type: llama
22
+ pipeline_tag: text-generation
23
+ prompt_template: '<|im_start|>system
24
+
25
+ {system_message}<|im_end|>
26
+
27
+ <|im_start|>user
28
+
29
+ {prompt}<|im_end|>
30
+
31
+ <|im_start|>assistant
32
+
33
+ '
34
+ quantized_by: TheBloke
35
+ ---
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
+ # Leo Hessianai 7B Chat Bilingual - GGUF
55
+ - Model creator: [LAION LeoLM](https://huggingface.co/LeoLM)
56
+ - Original model: [Leo Hessianai 7B Chat Bilingual](https://huggingface.co/LeoLM/leo-hessianai-7b-chat-bilingual)
57
+
58
+ <!-- description start -->
59
+ ## Description
60
+
61
+ This repo contains GGUF format model files for [LAION LeoLM's Leo Hessianai 7B Chat Bilingual](https://huggingface.co/LeoLM/leo-hessianai-7b-chat-bilingual).
62
+
63
+ <!-- description end -->
64
+ <!-- README_GGUF.md-about-gguf start -->
65
+ ### About GGUF
66
+
67
+ 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.
68
+
69
+ Here is an incomplate list of clients and libraries that are known to support GGUF:
70
+
71
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
72
+ * [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.
73
+ * [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.
74
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration.
75
+ * [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.
76
+ * [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.
77
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
78
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
79
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
80
+
81
+ <!-- README_GGUF.md-about-gguf end -->
82
+ <!-- repositories-available start -->
83
+ ## Repositories available
84
+
85
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-AWQ)
86
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GPTQ)
87
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF)
88
+ * [LAION LeoLM's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/LeoLM/leo-hessianai-7b-chat-bilingual)
89
+ <!-- repositories-available end -->
90
+
91
+ <!-- prompt-template start -->
92
+ ## Prompt template: ChatML
93
+
94
+ ```
95
+ <|im_start|>system
96
+ {system_message}<|im_end|>
97
+ <|im_start|>user
98
+ {prompt}<|im_end|>
99
+ <|im_start|>assistant
100
+
101
+ ```
102
+
103
+ <!-- prompt-template end -->
104
+
105
+
106
+ <!-- compatibility_gguf start -->
107
+ ## Compatibility
108
+
109
+ 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)
110
+
111
+ They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
112
+
113
+ ## Explanation of quantisation methods
114
+ <details>
115
+ <summary>Click to see details</summary>
116
+
117
+ The new methods available are:
118
+ * 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)
119
+ * 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.
120
+ * 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.
121
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
122
+ * 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
123
+
124
+ Refer to the Provided Files table below to see what files use which methods, and how.
125
+ </details>
126
+ <!-- compatibility_gguf end -->
127
+
128
+ <!-- README_GGUF.md-provided-files start -->
129
+ ## Provided files
130
+
131
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
132
+ | ---- | ---- | ---- | ---- | ---- | ----- |
133
+ | [leo-hessianai-7b-chat-bilingual.Q2_K.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q2_K.gguf) | Q2_K | 2 | 2.83 GB| 5.33 GB | smallest, significant quality loss - not recommended for most purposes |
134
+ | [leo-hessianai-7b-chat-bilingual.Q3_K_S.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q3_K_S.gguf) | Q3_K_S | 3 | 2.95 GB| 5.45 GB | very small, high quality loss |
135
+ | [leo-hessianai-7b-chat-bilingual.Q3_K_M.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q3_K_M.gguf) | Q3_K_M | 3 | 3.30 GB| 5.80 GB | very small, high quality loss |
136
+ | [leo-hessianai-7b-chat-bilingual.Q3_K_L.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q3_K_L.gguf) | Q3_K_L | 3 | 3.60 GB| 6.10 GB | small, substantial quality loss |
137
+ | [leo-hessianai-7b-chat-bilingual.Q4_0.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q4_0.gguf) | Q4_0 | 4 | 3.83 GB| 6.33 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
138
+ | [leo-hessianai-7b-chat-bilingual.Q4_K_S.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q4_K_S.gguf) | Q4_K_S | 4 | 3.86 GB| 6.36 GB | small, greater quality loss |
139
+ | [leo-hessianai-7b-chat-bilingual.Q4_K_M.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q4_K_M.gguf) | Q4_K_M | 4 | 4.08 GB| 6.58 GB | medium, balanced quality - recommended |
140
+ | [leo-hessianai-7b-chat-bilingual.Q5_0.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q5_0.gguf) | Q5_0 | 5 | 4.65 GB| 7.15 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
141
+ | [leo-hessianai-7b-chat-bilingual.Q5_K_S.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q5_K_S.gguf) | Q5_K_S | 5 | 4.65 GB| 7.15 GB | large, low quality loss - recommended |
142
+ | [leo-hessianai-7b-chat-bilingual.Q5_K_M.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q5_K_M.gguf) | Q5_K_M | 5 | 4.78 GB| 7.28 GB | large, very low quality loss - recommended |
143
+ | [leo-hessianai-7b-chat-bilingual.Q6_K.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q6_K.gguf) | Q6_K | 6 | 5.53 GB| 8.03 GB | very large, extremely low quality loss |
144
+ | [leo-hessianai-7b-chat-bilingual.Q8_0.gguf](https://huggingface.co/TheBloke/leo-hessianai-7B-chat-bilingual-GGUF/blob/main/leo-hessianai-7b-chat-bilingual.Q8_0.gguf) | Q8_0 | 8 | 7.16 GB| 9.66 GB | very large, extremely low quality loss - not recommended |
145
+
146
+ **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.
147
+
148
+
149
+
150
+ <!-- README_GGUF.md-provided-files end -->
151
+
152
+ <!-- README_GGUF.md-how-to-download start -->
153
+ ## How to download GGUF files
154
+
155
+ **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.
156
+
157
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
158
+ - LM Studio
159
+ - LoLLMS Web UI
160
+ - Faraday.dev
161
+
162
+ ### In `text-generation-webui`
163
+
164
+ Under Download Model, you can enter the model repo: TheBloke/leo-hessianai-7B-chat-bilingual-GGUF and below it, a specific filename to download, such as: leo-hessianai-7b-chat-bilingual.Q4_K_M.gguf.
165
+
166
+ Then click Download.
167
+
168
+ ### On the command line, including multiple files at once
169
+
170
+ I recommend using the `huggingface-hub` Python library:
171
+
172
+ ```shell
173
+ pip3 install huggingface-hub
174
+ ```
175
+
176
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
177
+
178
+ ```shell
179
+ huggingface-cli download TheBloke/leo-hessianai-7B-chat-bilingual-GGUF leo-hessianai-7b-chat-bilingual.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
180
+ ```
181
+
182
+ <details>
183
+ <summary>More advanced huggingface-cli download usage</summary>
184
+
185
+ You can also download multiple files at once with a pattern:
186
+
187
+ ```shell
188
+ huggingface-cli download TheBloke/leo-hessianai-7B-chat-bilingual-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
189
+ ```
190
+
191
+ 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).
192
+
193
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
194
+
195
+ ```shell
196
+ pip3 install hf_transfer
197
+ ```
198
+
199
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
200
+
201
+ ```shell
202
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/leo-hessianai-7B-chat-bilingual-GGUF leo-hessianai-7b-chat-bilingual.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
203
+ ```
204
+
205
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
206
+ </details>
207
+ <!-- README_GGUF.md-how-to-download end -->
208
+
209
+ <!-- README_GGUF.md-how-to-run start -->
210
+ ## Example `llama.cpp` command
211
+
212
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
213
+
214
+ ```shell
215
+ ./main -ngl 32 -m leo-hessianai-7b-chat-bilingual.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"
216
+ ```
217
+
218
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
219
+
220
+ 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.
221
+
222
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
223
+
224
+ 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)
225
+
226
+ ## How to run in `text-generation-webui`
227
+
228
+ Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
229
+
230
+ ## How to run from Python code
231
+
232
+ 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.
233
+
234
+ ### How to load this model in Python code, using ctransformers
235
+
236
+ #### First install the package
237
+
238
+ Run one of the following commands, according to your system:
239
+
240
+ ```shell
241
+ # Base ctransformers with no GPU acceleration
242
+ pip install ctransformers
243
+ # Or with CUDA GPU acceleration
244
+ pip install ctransformers[cuda]
245
+ # Or with AMD ROCm GPU acceleration (Linux only)
246
+ CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
247
+ # Or with Metal GPU acceleration for macOS systems only
248
+ CT_METAL=1 pip install ctransformers --no-binary ctransformers
249
+ ```
250
+
251
+ #### Simple ctransformers example code
252
+
253
+ ```python
254
+ from ctransformers import AutoModelForCausalLM
255
+
256
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
257
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/leo-hessianai-7B-chat-bilingual-GGUF", model_file="leo-hessianai-7b-chat-bilingual.Q4_K_M.gguf", model_type="llama", gpu_layers=50)
258
+
259
+ print(llm("AI is going to"))
260
+ ```
261
+
262
+ ## How to use with LangChain
263
+
264
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
265
+
266
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
267
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
268
+
269
+ <!-- README_GGUF.md-how-to-run end -->
270
+
271
+ <!-- footer start -->
272
+ <!-- 200823 -->
273
+ ## Discord
274
+
275
+ For further support, and discussions on these models and AI in general, join us at:
276
+
277
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
278
+
279
+ ## Thanks, and how to contribute
280
+
281
+ Thanks to the [chirper.ai](https://chirper.ai) team!
282
+
283
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
284
+
285
+ 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.
286
+
287
+ 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.
288
+
289
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
290
+
291
+ * Patreon: https://patreon.com/TheBlokeAI
292
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
293
+
294
+ **Special thanks to**: Aemon Algiz.
295
+
296
+ **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
297
+
298
+
299
+ Thank you to all my generous patrons and donaters!
300
+
301
+ And thank you again to a16z for their generous grant.
302
+
303
+ <!-- footer end -->
304
+
305
+ <!-- original-model-card start -->
306
+ # Original model card: LAION LeoLM's Leo Hessianai 7B Chat Bilingual
307
+
308
+ # LAION LeoLM: **L**inguistically **E**nhanced **O**pen **L**anguage **M**odel
309
+ Meet LeoLM, the first open and commercially available German Foundation Language Model built on Llama-2.
310
+ Our models extend Llama-2's capabilities into German through continued pretraining on a large corpus of German-language and mostly locality specific text.
311
+ Thanks to a compute grant at HessianAI's new supercomputer **42**, we release two foundation models trained with 8k context length,
312
+ [`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! 👀).
313
+ With this release, we hope to bring a new wave of opportunities to German open-source and commercial LLM research and accelerate adoption.
314
+ Read our [blog post]() or our paper (preprint coming soon) for more details!
315
+
316
+ *A project by Björn Plüster and Christoph Schuhmann in collaboration with LAION and HessianAI.*
317
+
318
+ ## LeoLM Chat
319
+ `LeoLM/leo-hessianai-7b-chat-bilingual` is a bilingual English-German chat model built on our foundation model `LeoLM/leo-hessianai-7b` and finetuned on a selection of German translateed instruction datasets and their English counterparts.
320
+ The model performs exceptionally well on writing, explanation and discussion tasks but struggles somewhat with math and advanced reasoning. See our MT-Bench scores:
321
+ ```
322
+ {
323
+ "first_turn": 5.64375,
324
+ "second_turn": 4.075,
325
+ "categories": {
326
+ "writing": 5.925,
327
+ "roleplay": 5.25,
328
+ "reasoning": 3.1,
329
+ "math": 1.8,
330
+ "coding": 3.4,
331
+ "extraction": 5,
332
+ "stem": 6.5,
333
+ "humanities": 7.9
334
+ },
335
+ "average": 4.859375
336
+ }
337
+ ```
338
+
339
+ ## Model Details
340
+
341
+ - **Finetuned from:** [LeoLM/leo-hessianai-7b](https://huggingface.co/LeoLM/leo-hessianai-7b)
342
+ - **Model type:** Causal decoder-only transformer language model
343
+ - **Language:** English and German
344
+ - **Demo:** [Web Demo]()
345
+ - **License:** [LLAMA 2 COMMUNITY LICENSE AGREEMENT](https://huggingface.co/meta-llama/Llama-2-70b/raw/main/LICENSE.txt)
346
+ - **Contact:** [LAION Discord](https://discord.com/invite/eq3cAMZtCC) or [Björn Plüster](mailto:bjoern.pl@outlook.de)
347
+
348
+
349
+ ## Use in 🤗Transformers
350
+ First install direct dependencies:
351
+ ```
352
+ pip install transformers torch sentencepiece
353
+ ```
354
+ If you want faster inference using flash-attention2, you need to install these dependencies:
355
+ ```bash
356
+ pip install packaging ninja
357
+ pip install flash-attn==v2.1.1 --no-build-isolation
358
+ pip install git+https://github.com/HazyResearch/flash-attention.git@v2.1.1#subdirectory=csrc/rotary
359
+ ```
360
+ Then load the model in transformers:
361
+ ```python
362
+ from transformers import pipeline
363
+ import torch
364
+
365
+ system_prompt = """<|im_start|>system
366
+ Dies ist eine Unterhaltung zwischen einem intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
367
+ Der Assistent gibt ausführliche, hilfreiche und ehrliche Antworten.<|im_end|>
368
+
369
+ """
370
+ prompt_format = "<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
371
+ prompt = "Erkläre mir wie die Fahrradwegesituation in Hamburg ist."
372
+
373
+ generator = pipeline(model="LeoLM/leo-hessianai-7b-chat-bilingual", device="cuda", torch_dtype=torch.float16, trust_remote_code=True) # True for flash-attn2 else False
374
+ print(generator(prompt_format.format(prompt=prompt), do_sample=True, top_p=0.95, max_length=8192))
375
+ ```
376
+
377
+ "*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.*
378
+
379
+ *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.*"
380
+
381
+ ## Prompting / Prompt Template
382
+
383
+ Prompt dialogue template (ChatML format):
384
+
385
+ ```
386
+ """
387
+ <|im_start|>system
388
+ {system_message}<|im_end|>
389
+ <|im_start|>user
390
+ {prompt}<|im_end|>
391
+ <|im_start|>assistant
392
+ """
393
+ ```
394
+
395
+ The model input can contain multiple conversation turns between user and assistant, e.g.
396
+ ```
397
+ <|im_start|>user
398
+ {prompt 1}<|im_end|>
399
+ <|im_start|>assistant
400
+ {reply 1}<|im_end|>
401
+ <|im_start|>user
402
+ {prompt 2}<|im_end|>
403
+ <|im_start|>assistant
404
+ (...)
405
+ ```
406
+
407
+ ## Ethical Considerations and Limitations
408
+
409
+ LeoLM has been tested in English and German, and has not covered, nor could it cover all scenarios.
410
+ For these reasons, as with all LLMs, the potential outputs of `LeoLM/leo-hessianai-7b-chat` cannot be predicted
411
+ in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
412
+ to user prompts. Therefore, before deploying any applications of `LeoLM/leo-hessianai-7b-chat`, developers should
413
+ perform safety testing and tuning tailored to their specific applications of the model.
414
+
415
+ Please see Meta's [Responsible Use Guide](https://ai.meta.com/llama/responsible-use-guide/).
416
+
417
+ ## Finetuning Details
418
+
419
+ | Hyperparameter | Value |
420
+ |---|---|
421
+ | Num epochs | 3 |
422
+ | Examples per epoch | 233275 |
423
+ | Global batch size | 256 |
424
+ | Learning rate | 3e-5 |
425
+ | Warmup steps | 100 |
426
+ | LR scheduler | Cosine |
427
+ | Adam betas | (0.9, 0.95) |
428
+ | Weight decay | 0.001 |
429
+
430
+
431
+ ## Dataset Details
432
+ ```
433
+ ## Stats for 'Subset of LeoLM/OpenSchnabeltier' (21314 samples (100.0%))
434
+ -----------------
435
+ Accepted: 21314/21314 (100.0%)
436
+ Accepted tokens: 8134690
437
+ Skipped: 0 (0.0%)
438
+ Min tokens per sample: 25
439
+ Max tokens per sample: 1202
440
+ Avg tokens per sample: 381.65947264708643
441
+ -----------------
442
+
443
+ ## Stats for 'Subset of garage-bAInd/Open-Platypus' (24427 samples (100.0%))
444
+ -----------------
445
+ Accepted: 24427/24427 (100.0%)
446
+ Accepted tokens: 9549043
447
+ Skipped: 0 (0.0%)
448
+ Min tokens per sample: 23
449
+ Max tokens per sample: 5054
450
+ Avg tokens per sample: 390.9216440823679
451
+ -----------------
452
+
453
+ ## Stats for 'Subset of WizardLM/WizardLM_evol_instruct_70k' (68600 samples (100.0%))
454
+ -----------------
455
+ Accepted: 68600/68600 (100.0%)
456
+ Accepted tokens: 33045040
457
+ Skipped: 0 (0.0%)
458
+ Min tokens per sample: 18
459
+ Max tokens per sample: 11810
460
+ Avg tokens per sample: 481.7061224489796
461
+ -----------------
462
+
463
+ ## Stats for 'Subset of FreedomIntelligence/evol-instruct-deutsch' (57841 samples (100.0%))
464
+ -----------------
465
+ Accepted: 57841/57841 (100.0%)
466
+ Accepted tokens: 42958192
467
+ Skipped: 0 (0.0%)
468
+ Min tokens per sample: 33
469
+ Max tokens per sample: 5507
470
+ Avg tokens per sample: 742.6944900675991
471
+ -----------------
472
+
473
+ ## Stats for 'Subset of FreedomIntelligence/alpaca-gpt4-deutsch' (48969 samples (100.0%))
474
+ -----------------
475
+ Accepted: 48969/48969 (100.0%)
476
+ Accepted tokens: 13372005
477
+ Skipped: 0 (0.0%)
478
+ Min tokens per sample: 19
479
+ Max tokens per sample: 1359
480
+ Avg tokens per sample: 273.07082031489307
481
+ -----------------
482
+
483
+ ## Stats for 'Subset of LeoLM/German_Songs' (490 samples (100.0%))
484
+ -----------------
485
+ Accepted: 490/490 (100.0%)
486
+ Accepted tokens: 618642
487
+ Skipped: 0 (0.0%)
488
+ Min tokens per sample: 747
489
+ Max tokens per sample: 1678
490
+ Avg tokens per sample: 1262.534693877551
491
+ -----------------
492
+
493
+
494
+ ## Stats for 'Subset of LeoLM/German_Poems' (392 samples (100.0%))
495
+ -----------------
496
+ Accepted: 392/392 (100.0%)
497
+ Accepted tokens: 187897
498
+ Skipped: 0 (0.0%)
499
+ Min tokens per sample: 231
500
+ Max tokens per sample: 826
501
+ Avg tokens per sample: 479.3290816326531
502
+ -----------------
503
+
504
+ ## Stats for 'Subset of OpenAssistant/OASST_DE' (3646 samples (100.0%))
505
+ -----------------
506
+ Accepted: 3646/3646 (100.0%)
507
+ Accepted tokens: 2338738
508
+ Skipped: 0 (0.0%)
509
+ Min tokens per sample: 29
510
+ Max tokens per sample: 2484
511
+ Avg tokens per sample: 641.4530992868897
512
+ -----------------
513
+
514
+ ## Stats for 'Subset of bjoernp/oasst25-08-23-filtered' (8922 samples (100.0%))
515
+ -----------------
516
+ Accepted: 8922/8922 (100.0%)
517
+ Accepted tokens: 4526427
518
+ Skipped: 0 (0.0%)
519
+ Min tokens per sample: 23
520
+ Max tokens per sample: 5407
521
+ Avg tokens per sample: 507.3332212508406
522
+ -----------------
523
+
524
+ ## Stats for 'total' (235632 samples (100.0%))
525
+ -----------------
526
+ Accepted: 235632/235632 (100.0%)
527
+ Accepted tokens: 115862397
528
+ Skipped: 0 (0.0%)
529
+ Min tokens per sample: 18
530
+ Max tokens per sample: 11810
531
+ Avg tokens per sample: 491.70909299246284
532
+ -----------------
533
+ ```
534
+
535
+ <!-- original-model-card end -->