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
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 |
+
|
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 Mistral Hessianai 7B Chat - GGUF
|
52 |
+
- Model creator: [LAION LeoLM](https://huggingface.co/LeoLM)
|
53 |
+
- Original model: [Leo Mistral Hessianai 7B Chat](https://huggingface.co/LeoLM/leo-mistral-hessianai-7b-chat)
|
54 |
+
|
55 |
+
<!-- description start -->
|
56 |
+
## Description
|
57 |
+
|
58 |
+
This repo contains GGUF format model files for [LAION LeoLM's Leo Mistral Hessianai 7B Chat](https://huggingface.co/LeoLM/leo-mistral-hessianai-7b-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-Mistral-Hessianai-7B-Chat-AWQ)
|
83 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GPTQ)
|
84 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-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-mistral-hessianai-7b-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-mistral-hessianai-7b-chat.Q2_K.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q2_K.gguf) | Q2_K | 2 | 3.08 GB| 5.58 GB | smallest, significant quality loss - not recommended for most purposes |
|
131 |
+
| [leo-mistral-hessianai-7b-chat.Q3_K_S.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q3_K_S.gguf) | Q3_K_S | 3 | 3.17 GB| 5.67 GB | very small, high quality loss |
|
132 |
+
| [leo-mistral-hessianai-7b-chat.Q3_K_M.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q3_K_M.gguf) | Q3_K_M | 3 | 3.52 GB| 6.02 GB | very small, high quality loss |
|
133 |
+
| [leo-mistral-hessianai-7b-chat.Q3_K_L.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q3_K_L.gguf) | Q3_K_L | 3 | 3.82 GB| 6.32 GB | small, substantial quality loss |
|
134 |
+
| [leo-mistral-hessianai-7b-chat.Q4_0.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q4_0.gguf) | Q4_0 | 4 | 4.11 GB| 6.61 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
|
135 |
+
| [leo-mistral-hessianai-7b-chat.Q4_K_S.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q4_K_S.gguf) | Q4_K_S | 4 | 4.14 GB| 6.64 GB | small, greater quality loss |
|
136 |
+
| [leo-mistral-hessianai-7b-chat.Q4_K_M.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q4_K_M.gguf) | Q4_K_M | 4 | 4.37 GB| 6.87 GB | medium, balanced quality - recommended |
|
137 |
+
| [leo-mistral-hessianai-7b-chat.Q5_0.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q5_0.gguf) | Q5_0 | 5 | 5.00 GB| 7.50 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
|
138 |
+
| [leo-mistral-hessianai-7b-chat.Q5_K_S.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q5_K_S.gguf) | Q5_K_S | 5 | 5.00 GB| 7.50 GB | large, low quality loss - recommended |
|
139 |
+
| [leo-mistral-hessianai-7b-chat.Q5_K_M.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q5_K_M.gguf) | Q5_K_M | 5 | 5.13 GB| 7.63 GB | large, very low quality loss - recommended |
|
140 |
+
| [leo-mistral-hessianai-7b-chat.Q6_K.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q6_K.gguf) | Q6_K | 6 | 5.94 GB| 8.44 GB | very large, extremely low quality loss |
|
141 |
+
| [leo-mistral-hessianai-7b-chat.Q8_0.gguf](https://huggingface.co/TheBloke/Leo-Mistral-Hessianai-7B-Chat-GGUF/blob/main/leo-mistral-hessianai-7b-chat.Q8_0.gguf) | Q8_0 | 8 | 7.70 GB| 10.20 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-Mistral-Hessianai-7B-Chat-GGUF and below it, a specific filename to download, such as: leo-mistral-hessianai-7b-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-Mistral-Hessianai-7B-Chat-GGUF leo-mistral-hessianai-7b-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-Mistral-Hessianai-7B-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-Mistral-Hessianai-7B-Chat-GGUF leo-mistral-hessianai-7b-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-mistral-hessianai-7b-chat.Q4_K_M.gguf --color -c 2048 --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 2048` 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-Mistral-Hessianai-7B-Chat-GGUF", model_file="leo-mistral-hessianai-7b-chat.Q4_K_M.gguf", model_type="mistral", 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**: 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
|
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 Mistral Hessianai 7B 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 and Mistral.
|
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 three foundation models trained with 8k context length.
|
309 |
+
[`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! 👀).
|
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](https://laion.ai/blog/leo-lm/) 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-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.
|
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.1,
|
321 |
+
"second_turn": 4.7,
|
322 |
+
"categories": {
|
323 |
+
"writing": 6.8,
|
324 |
+
"roleplay": 6.35,
|
325 |
+
"reasoning": 3.3,
|
326 |
+
"math": 2.75,
|
327 |
+
"coding": 4.4,
|
328 |
+
"extraction": 4.5,
|
329 |
+
"stem": 6.85,
|
330 |
+
"humanities": 8.25
|
331 |
+
},
|
332 |
+
"average": 5.4
|
333 |
+
}
|
334 |
+
```
|
335 |
+
|
336 |
+
## Model Details
|
337 |
+
|
338 |
+
- **Finetuned from:** [LeoLM/leo-mistral-hessianai-7b](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 coming soon !]()
|
342 |
+
- **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)
|
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
|
355 |
+
```
|
356 |
+
Then load the model in transformers:
|
357 |
+
```python
|
358 |
+
from transformers import pipeline
|
359 |
+
import torch
|
360 |
+
|
361 |
+
system_prompt = """<|im_start|>system
|
362 |
+
Dies ist eine Unterhaltung zwischen einem intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
|
363 |
+
Der Assistent gibt ausführliche, hilfreiche und ehrliche Antworten.<|im_end|>
|
364 |
+
|
365 |
+
"""
|
366 |
+
prompt_format = "<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
|
367 |
+
prompt = "Erkläre mir wie die Fahrradwegesituation in Hamburg ist."
|
368 |
+
|
369 |
+
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
|
370 |
+
print(generator(prompt_format.format(prompt=prompt), do_sample=True, top_p=0.95, max_length=8192))
|
371 |
+
```
|
372 |
+
|
373 |
+
"*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.*
|
374 |
+
|
375 |
+
*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.*"
|
376 |
+
|
377 |
+
## Prompting / Prompt Template
|
378 |
+
|
379 |
+
Prompt dialogue template (ChatML format):
|
380 |
+
|
381 |
+
```
|
382 |
+
"""
|
383 |
+
<|im_start|>system
|
384 |
+
{system_message}<|im_end|>
|
385 |
+
<|im_start|>user
|
386 |
+
{prompt}<|im_end|>
|
387 |
+
<|im_start|>assistant
|
388 |
+
"""
|
389 |
+
```
|
390 |
+
|
391 |
+
The model input can contain multiple conversation turns between user and assistant, e.g.
|
392 |
+
```
|
393 |
+
<|im_start|>user
|
394 |
+
{prompt 1}<|im_end|>
|
395 |
+
<|im_start|>assistant
|
396 |
+
{reply 1}<|im_end|>
|
397 |
+
<|im_start|>user
|
398 |
+
{prompt 2}<|im_end|>
|
399 |
+
<|im_start|>assistant
|
400 |
+
(...)
|
401 |
+
```
|
402 |
+
|
403 |
+
## Ethical Considerations and Limitations
|
404 |
+
|
405 |
+
LeoLM has been tested in English and German, and has not covered, nor could it cover all scenarios.
|
406 |
+
For these reasons, as with all LLMs, the potential outputs of `LeoLM/leo-mistral-hessianai-7b-chat` cannot be predicted
|
407 |
+
in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
|
408 |
+
to user prompts. Therefore, before deploying any applications of `LeoLM/leo-mistral-hessianai-7b-chat`, developers should
|
409 |
+
perform safety testing and tuning tailored to their specific applications of the model.
|
410 |
+
|
411 |
+
Please see Meta's [Responsible Use Guide](https://ai.meta.com/llama/responsible-use-guide/).
|
412 |
+
|
413 |
+
## Finetuning Details
|
414 |
+
|
415 |
+
| Hyperparameter | Value |
|
416 |
+
|---|---|
|
417 |
+
| Num epochs | 4 |
|
418 |
+
| Examples per epoch | 131214 |
|
419 |
+
| Global batch size | 256 |
|
420 |
+
| Learning rate | 1e-5 |
|
421 |
+
| Warmup steps | 100 |
|
422 |
+
| LR scheduler | Cosine |
|
423 |
+
| Adam betas | (0.9, 0.95) |
|
424 |
+
|
425 |
+
|
426 |
+
## Dataset Details
|
427 |
+
```
|
428 |
+
## Stats for 'Subset of OpenAssistant/OASST-DE' (3534 samples (100.0%))
|
429 |
+
-----------------
|
430 |
+
Accepted: 3534/3534 (100.0%)
|
431 |
+
Accepted tokens: 2259302
|
432 |
+
Skipped: 0 (0.0%)
|
433 |
+
Min tokens per sample: 29
|
434 |
+
Max tokens per sample: 2484
|
435 |
+
Avg tokens per sample: 639.3044708545557
|
436 |
+
-----------------
|
437 |
+
|
438 |
+
## Stats for 'Subset of FreedomIntelligence/evol-instruct-deutsch' (57841 samples (100.0%))
|
439 |
+
-----------------
|
440 |
+
Accepted: 57841/57841 (100.0%)
|
441 |
+
Accepted tokens: 42958192
|
442 |
+
Skipped: 0 (0.0%)
|
443 |
+
Min tokens per sample: 33
|
444 |
+
Max tokens per sample: 5507
|
445 |
+
Avg tokens per sample: 742.6944900675991
|
446 |
+
-----------------
|
447 |
+
|
448 |
+
## Stats for 'Subset of FreedomIntelligence/alpaca-gpt4-deutsch' (48969 samples (100.0%))
|
449 |
+
-----------------
|
450 |
+
Accepted: 48969/48969 (100.0%)
|
451 |
+
Accepted tokens: 13372005
|
452 |
+
Skipped: 0 (0.0%)
|
453 |
+
Min tokens per sample: 19
|
454 |
+
Max tokens per sample: 1359
|
455 |
+
Avg tokens per sample: 273.07082031489307
|
456 |
+
-----------------
|
457 |
+
|
458 |
+
## Stats for 'Subset of LeoLM/OpenSchnabeltier' (21314 samples (100.0%))
|
459 |
+
-----------------
|
460 |
+
Accepted: 21314/21314 (100.0%)
|
461 |
+
Accepted tokens: 8134690
|
462 |
+
Skipped: 0 (0.0%)
|
463 |
+
Min tokens per sample: 25
|
464 |
+
Max tokens per sample: 1202
|
465 |
+
Avg tokens per sample: 381.65947264708643
|
466 |
+
-----------------
|
467 |
+
|
468 |
+
## Stats for 'Subset of LeoLM/German_Poems' (490 samples (100.0%))
|
469 |
+
-----------------
|
470 |
+
Accepted: 490/490 (100.0%)
|
471 |
+
Accepted tokens: 618642
|
472 |
+
Skipped: 0 (0.0%)
|
473 |
+
Min tokens per sample: 747
|
474 |
+
Max tokens per sample: 1678
|
475 |
+
Avg tokens per sample: 1262.534693877551
|
476 |
+
-----------------
|
477 |
+
|
478 |
+
## Stats for 'Subset of LeoLM/German_Songs' (392 samples (100.0%))
|
479 |
+
-----------------
|
480 |
+
Accepted: 392/392 (100.0%)
|
481 |
+
Accepted tokens: 187897
|
482 |
+
Skipped: 0 (0.0%)
|
483 |
+
Min tokens per sample: 231
|
484 |
+
Max tokens per sample: 826
|
485 |
+
Avg tokens per sample: 479.3290816326531
|
486 |
+
-----------------
|
487 |
+
|
488 |
+
## Stats for 'total' (132540 samples (100.0%))
|
489 |
+
-----------------
|
490 |
+
Accepted: 132540/132540 (100.0%)
|
491 |
+
Accepted tokens: 67530728
|
492 |
+
Skipped: 0 (0.0%)
|
493 |
+
Min tokens per sample: 19
|
494 |
+
Max tokens per sample: 5507
|
495 |
+
Avg tokens per sample: 509.51205673758864
|
496 |
+
-----------------
|
497 |
+
```
|
498 |
+
|
499 |
+
<!-- original-model-card end -->
|