Views
No views yet

[INST] and [/INST] tokens. The very first instruction should begin with a begin of sentence id. The next instructions should not. The assistant generation will be ended by the end-of-sentence token id.text = "<s>[INST] What is your favourite condiment? [/INST]"
"Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
"[INST] Do you have mayonnaise recipes? [/INST]"apply_chat_template() method:1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3device = "cuda" # the device to load the model onto
4
5model = AutoModelForCausalLM.from_pretrained("mayflowergmbh/Brezn-7b")
6tokenizer = AutoTokenizer.from_pretrained("mayflowergmbh/Brezn-7b")
7
8messages = [
9 {"role": "user", "content": "Was ist dein Lieblingsgewürz??"},
10 {"role": "assistant", "content": "Nun, ich mag besonders gerne einen guten Spritzer frischen Zitronensaft. Er fügt genau die richtige Menge an würzigem Geschmack hinzu, egal was ich gerade in der Küche zubereite!"},
11 {"role": "user", "content": "Hast du Mayonnaise-Rezepte?"}
12]
13
14encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
15
16model_inputs = encodeds.to(device)
17model.to(device)
18
19generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
20decoded = tokenizer.batch_decode(generated_ids)
21print(decoded[0])1{
2 "first_turn": 7.6625,
3 "second_turn": 7.31875,
4 "categories": {
5 "writing": 8.75,
6 "roleplay": 8.5,
7 "reasoning": 6.1,
8 "math": 5.05,
9 "coding": 5.4,
10 "extraction": 7.975,
11 "stem": 9,
12 "humanities": 9.15
13 },
14 "average": 7.490625
15}1models:
2 - model: mistralai/Mistral-7B-v0.1
3 # no parameters necessary for base model
4 - model: FelixChao/WestSeverus-7B-DPO-v2
5 parameters:
6 density: 0.60
7 weight: 0.30
8 - model: mayflowergmbh/Wiedervereinigung-7b-dpo-laser
9 parameters:
10 density: 0.65
11 weight: 0.40
12 - model: cognitivecomputations/openchat-3.5-0106-laser
13 parameters:
14 density: 0.6
15 weight: 0.3
16merge_method: dare_ties
17base_model: mistralai/Mistral-7B-v0.1
18parameters:
19 int8_mask: true
20dtype: bfloat16
21random_seed: 0