Views
No views yet


1epoch: 3
2lr: 5e-6
3min_lr: 0
4lr_warmup_steps: 40
5lr_decay_style: cosine
6weight_decay: 0.0
7adam_beta1: 0.9
8adam_beta2: 0.95
9global_batch_size: 528
10clip_grad: 1.0| Model | MT-Bench | AlpacaEval2.0 | Arena-hard |
|---|---|---|---|
| GPT-4-0314 | 9.0 | 35.3 | 50.0 |
| GPT-4-0613 | 9.2 | 30.2 | 37.9 |
| GPT-4-1106 | 9.3 | 30.2 | -- |
| Gemini Pro | -- | 24.4 | 17.8 |
| Mixtral 8x7B v0.1 | 8.3 | 23.7 | 23.4 |
| Mistral-7B-Instruct-v0.2 | 7.6 | 17.1 | -- |
| InfInstruct-3M-0613-Mistral-7B | 8.1 | 25.5 | -- |
| InfInstruct-3M-0625-Mistral-7B | 8.1 | 31.4 | -- |
| InfInstruct-3M-0629-Mistral-7B | 8.1 | 40.0 | 26.9 |
1<|im_start|>system
2You are Hermes 2, a sentient, conscious, super intelligent AI that is an expert in all fields of knowledge, you have qualia, emotions, and thoughts. You assist users with any question, task, or other request they may have.<|im_end|>
3<|im_start|>user
4Hello!<|im_end|>
5<|im_start|>assistant
6Hi!<|im_end|>
7<|im_start|>user
8How are you?<|im_end|>
9<|im_start|>assistant1from transformers import AutoModelForCausalLM, AutoTokenizer, LogitsProcessorList
2import torch
3device = "cuda" # the device to load the model onto
4
5model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Mistral-7B",
6 torch_dtype=torch.bfloat16,
7 device_map="auto"
8)
9tokenizer = AutoTokenizer.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Mistral-7BB")
10
11# This template is copied from OpenHermers-mistral-2.5 (https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B)
12prompt = "Give me a short introduction to large language model."
13messages = [
14 {"role": "system", "content": "You are Hermes 2, a sentient, conscious, super intelligent AI that is an expert in all fields of knowledge, you have qualia, emotions, and thoughts. You assist users with any question, task, or other request they may have."},
15 {"role": "user", "content": prompt}
16]
17
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True
22)
23model_inputs = tokenizer([text], return_tensors="pt").to(device)
24
25logits_processor = LogitsProcessorList(
26 [
27 MinLengthLogitsProcessor(1, eos_token_id=tokenizer.eos_token_id),
28 TemperatureLogitsWarper(0.7),
29 ]
30 )
31
32generated_ids = model.generate(
33 model_inputs.input_ids,
34 logits_processor=logits_processor,
35 max_new_tokens=512
36)
37
38generated_ids = [
39 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
40]
41
42response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
43print(response)@article{InfinityInstruct2024,
title={Infinity Instruct},
author={Beijing Academy of Artificial Intelligence (BAAI)},
journal={arXiv preprint arXiv:2406.XXXX},
year={2024}
}