Views
No views yet

<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
main branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.desc_act. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|---|---|---|---|---|---|---|---|---|---|
| main | 4 | 128 | Yes | 0.1 | German Quad | 8192 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
| gptq-4bit-32g-actorder_True | 4 | 32 | Yes | 0.1 | German Quad | 8192 | 8.01 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
| gptq-8bit--1g-actorder_True | 8 | None | Yes | 0.1 | German Quad | 8192 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
| gptq-8bit-128g-actorder_True | 8 | 128 | Yes | 0.1 | German Quad | 8192 | 13.66 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
| gptq-8bit-32g-actorder_True | 8 | 32 | Yes | 0.1 | German Quad | 8192 | 14.55 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
| gptq-4bit-64g-actorder_True | 4 | 64 | Yes | 0.1 | German Quad | 8192 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
main branch, enter TheBloke/leo-hessianai-13B-chat-GPTQ in the "Download model" box.:branchname to the end of the download name, eg TheBloke/leo-hessianai-13B-chat-GPTQ:gptq-4bit-32g-actorder_Truehuggingface-hub Python library:pip3 install huggingface-hubmain branch to a folder called leo-hessianai-13B-chat-GPTQ:1mkdir leo-hessianai-13B-chat-GPTQ
2huggingface-cli download TheBloke/leo-hessianai-13B-chat-GPTQ --local-dir leo-hessianai-13B-chat-GPTQ --local-dir-use-symlinks False--revision parameter:1mkdir leo-hessianai-13B-chat-GPTQ
2huggingface-cli download TheBloke/leo-hessianai-13B-chat-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir leo-hessianai-13B-chat-GPTQ --local-dir-use-symlinks False--local-dir-use-symlinks False parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: ~/.cache/huggingface), and symlinks will be added to the specified --local-dir, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.HF_HOME environment variable, and/or the --cache-dir parameter to huggingface-cli.huggingface-cli, please see: HF -> Hub Python Library -> Download files -> Download from the CLI.hf_transfer:pip3 install hf_transferHF_HUB_ENABLE_HF_TRANSFER to 1:1mkdir leo-hessianai-13B-chat-GPTQ
2HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/leo-hessianai-13B-chat-GPTQ --local-dir leo-hessianai-13B-chat-GPTQ --local-dir-use-symlinks Falseset HF_HUB_ENABLE_HF_TRANSFER=1 before the download command.git (not recommended)git, use a command like this:git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/leo-hessianai-13B-chat-GPTQhuggingface-hub, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the .git folder as a blob.)TheBloke/leo-hessianai-13B-chat-GPTQ.TheBloke/leo-hessianai-13B-chat-GPTQ:gptq-4bit-32g-actorder_Trueleo-hessianai-13B-chat-GPTQquantize_config.json.1pip3 install transformers optimum
2pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.71pip3 uninstall -y auto-gptq
2git clone https://github.com/PanQiWei/AutoGPTQ
3cd AutoGPTQ
4git checkout v0.4.2
5pip3 install .1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2
3model_name_or_path = "TheBloke/leo-hessianai-13B-chat-GPTQ"
4# To use a different branch, change revision
5# For example: revision="gptq-4bit-32g-actorder_True"
6model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
7 device_map="auto",
8 trust_remote_code=False,
9 revision="main")
10
11tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
12
13prompt = "Tell me about AI"
14prompt_template=f'''<|im_start|>system
15{system_message}<|im_end|>
16<|im_start|>user
17{prompt}<|im_end|>
18<|im_start|>assistant
19'''
20
21print("\n\n*** Generate:")
22
23input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
24output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
25print(tokenizer.decode(output[0]))
26
27# Inference can also be done using transformers' pipeline
28
29print("*** Pipeline:")
30pipe = pipeline(
31 "text-generation",
32 model=model,
33 tokenizer=tokenizer,
34 max_new_tokens=512,
35 do_sample=True,
36 temperature=0.7,
37 top_p=0.95,
38 top_k=40,
39 repetition_penalty=1.1
40)
41
42print(pipe(prompt_template)[0]['generated_text'])LeoLM/leo-hessianai-7b and LeoLM/leo-hessianai-13b under the Llama-2 community license (70b also coming soon! 👀).
With this release, we hope to bring a new wave of opportunities to German open-source and commercial LLM research and accelerate adoption.
Read our blog post or our paper (preprint coming soon) for more details!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.
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:{
"first_turn": 6.525,
"second_turn": 5.15,
"categories": {
"writing": 6.925,
"roleplay": 6.7,
"reasoning": 4.55,
"math": 3.25,
"coding": 3.45,
"extraction": 5.4,
"stem": 7.55,
"humanities": 8.875
},
"average": 5.8375
}pip install transformers torch sentencepiece1pip install packaging ninja
2pip install flash-attn==v2.1.1 --no-build-isolation
3pip install git+https://github.com/HazyResearch/flash-attention.git@v2.1.1#subdirectory=csrc/rotary1from transformers import pipeline
2import torch
3
4system_prompt = """<|im_start|>system
5Dies ist eine Unterhaltung zwischen einem intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
6Der Assistent gibt ausführliche, hilfreiche und ehrliche Antworten.<|im_end|>
7
8"""
9prompt_format = "<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
10prompt = "Erkläre mir wie die Fahrradwegesituation in Hamburg ist."
11
12generator = pipeline(model="LeoLM/leo-hessianai-13b-chat", device="cuda", torch_dtype=torch.float16, trust_remote_code=True) # True for flash-attn2 else False
13print(generator(prompt_format.format(prompt=prompt), do_sample=True, top_p=0.95, max_length=8192))"""
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
"""<|im_start|>user
{prompt 1}<|im_end|>
<|im_start|>assistant
{reply 1}<|im_end|>
<|im_start|>user
{prompt 2}<|im_end|>
<|im_start|>assistant
(...)LeoLM/leo-hessianai-13b-chat cannot be predicted
in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses
to user prompts. Therefore, before deploying any applications of LeoLM/leo-hessianai-13b-chat, developers should
perform safety testing and tuning tailored to their specific applications of the model.| Hyperparameter | Value |
|---|---|
| Num epochs | 3 |
| Examples per epoch | 131214 |
| Global batch size | 256 |
| Learning rate | 3e-5 |
| Warmup steps | 100 |
| LR scheduler | Cosine |
| Adam betas | (0.9, 0.95) |
## Stats for 'Subset of OpenAssistant/OASST-DE' (3534 samples (100.0%))
-----------------
Accepted: 3534/3534 (100.0%)
Accepted tokens: 2259302
Skipped: 0 (0.0%)
Min tokens per sample: 29
Max tokens per sample: 2484
Avg tokens per sample: 639.3044708545557
-----------------
## Stats for 'Subset of FreedomIntelligence/evol-instruct-deutsch' (57841 samples (100.0%))
-----------------
Accepted: 57841/57841 (100.0%)
Accepted tokens: 42958192
Skipped: 0 (0.0%)
Min tokens per sample: 33
Max tokens per sample: 5507
Avg tokens per sample: 742.6944900675991
-----------------
## Stats for 'Subset of FreedomIntelligence/alpaca-gpt4-deutsch' (48969 samples (100.0%))
-----------------
Accepted: 48969/48969 (100.0%)
Accepted tokens: 13372005
Skipped: 0 (0.0%)
Min tokens per sample: 19
Max tokens per sample: 1359
Avg tokens per sample: 273.07082031489307
-----------------
## Stats for 'Subset of LeoLM/OpenSchnabeltier' (21314 samples (100.0%))
-----------------
Accepted: 21314/21314 (100.0%)
Accepted tokens: 8134690
Skipped: 0 (0.0%)
Min tokens per sample: 25
Max tokens per sample: 1202
Avg tokens per sample: 381.65947264708643
-----------------
## Stats for 'Subset of LeoLM/German_Poems' (490 samples (100.0%))
-----------------
Accepted: 490/490 (100.0%)
Accepted tokens: 618642
Skipped: 0 (0.0%)
Min tokens per sample: 747
Max tokens per sample: 1678
Avg tokens per sample: 1262.534693877551
-----------------
## Stats for 'Subset of LeoLM/German_Songs' (392 samples (100.0%))
-----------------
Accepted: 392/392 (100.0%)
Accepted tokens: 187897
Skipped: 0 (0.0%)
Min tokens per sample: 231
Max tokens per sample: 826
Avg tokens per sample: 479.3290816326531
-----------------
## Stats for 'total' (132540 samples (100.0%))
-----------------
Accepted: 132540/132540 (100.0%)
Accepted tokens: 67530728
Skipped: 0 (0.0%)
Min tokens per sample: 19
Max tokens per sample: 5507
Avg tokens per sample: 509.51205673758864
-----------------