GGUF
English
conversational
aashish1904 commited on
Commit
cd1d3c7
Β·
verified Β·
1 Parent(s): 6189bcf

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +167 -0
README.md ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: apache-2.0
5
+ datasets:
6
+ - BAAI/Infinity-Instruct
7
+ language:
8
+ - en
9
+
10
+ ---
11
+
12
+ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
13
+
14
+ # QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF
15
+ This is quantized version of [BAAI/Infinity-Instruct-7M-Gen-mistral-7B](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-mistral-7B) created using llama.cpp
16
+
17
+ # Original Model Card
18
+
19
+ # Infinity Instruct
20
+
21
+ <p align="center">
22
+ <img src="fig/Bk3NbjnJko51MTx1ZCScT2sqnGg.png" width="300">
23
+ </p>
24
+ <p align="center">
25
+ <em>Beijing Academy of Artificial Intelligence (BAAI)</em><br/>
26
+ <em>[Paper][Code][πŸ€—] (would be released soon)</em>
27
+ </p>
28
+
29
+ Infinity-Instruct-7M-Gen-Mistral-7B is an opensource supervised instruction tuning model without reinforcement learning from human feedback (RLHF). This model is just finetuned on [Infinity-Instruct-7M and Infinity-Instruct-Gen](https://huggingface.co/datasets/BAAI/Infinity-Instruct) and showing favorable results on AlpacaEval 2.0 compared to Mixtral 8x22B v0.1, Gemini Pro, and GPT-4.
30
+
31
+ ## **News**
32
+
33
+ - πŸ”₯πŸ”₯πŸ”₯[2024/08/02] We release the model weights of [InfInstruct-Llama3.1-70B Gen](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B), [InfInstruct-Llama3.1-8B Gen](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-8B), [InfInstruct-Mistral-7B Gen](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Mistral-7B).
34
+
35
+ - πŸ”₯πŸ”₯πŸ”₯[2024/08/02] We release the 7M foundational dataset [Infinity-Instruct-7M](https://huggingface.co/datasets/BAAI/Infinity-Instruct).
36
+
37
+ - πŸ”₯πŸ”₯πŸ”₯[2024/07/09] We release the model weights of [InfInstruct-Mistral-7B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Mistral-7B), [InfInstruct-Qwen2-7B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Qwen2-7B), [InfInstruct-Llama3-8B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Llama3-8B), [InfInstruct-Llama3-70B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Llama3-70B), and [InfInstruct-Yi-1.5-9B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Yi-1.5-9B).
38
+
39
+ - πŸ”₯πŸ”₯πŸ”₯[2024/07/09] We release the chat dataset [Infinity-Instruct-0625](https://huggingface.co/datasets/BAAI/Infinity-Instruct), it is a upgraded version of the Infinity-Instruct-0613.
40
+
41
+ - πŸ”₯πŸ”₯πŸ”₯[2024/06/28] We release the model weight of [InfInstruct-Llama3-70B 0613](https://huggingface.co/BAAI/Infinity-Instruct-3M-0613-Llama3-70B). It shows favorable results on AlpacaEval 2.0 compared to GPT4-0613 without RLHF.
42
+
43
+ - πŸ”₯πŸ”₯πŸ”₯[2024/06/21] We release the model weight of [InfInstruct-Mistral-7B 0613](https://huggingface.co/BAAI/Infinity-Instruct-3M-0613-Mistral-7B). It shows favorable results on AlpacaEval 2.0 compared to Mixtral 8x7B v0.1, Gemini Pro, and GPT-3.5 without RLHF.
44
+
45
+ - πŸ”₯πŸ”₯πŸ”₯[2024/06/13] We share the intermediate result of our data construction process (corresponding to the [InfInstruct-3M](https://huggingface.co/datasets/BAAI/Infinity-Instruct) in the table below). Our ongoing efforts focus on risk assessment and data generation. The finalized version with 10 million instructions is scheduled for release in late June.
46
+
47
+ ## **Training Details**
48
+
49
+ <p align="center">
50
+ <img src="fig/trainingflow.png">
51
+ </p>
52
+
53
+ Infinity-Instruct-7M-Gen-Mistral-7B is tuned on Million-level instruction dataset [Infinity-Instruct](https://huggingface.co/datasets/BAAI/Infinity-Instruct). First, we apply the foundational dataset Infinity-Instruct-7M to improve the foundational ability (math & code) of Mistral-7B-v0.1, and get the foundational instruct model Infinity-Instruct-7M-Mistral-7B. Then we finetune the Infinity-Instruct-7M-Mistral-7B to get the stronger chat model Infinity-Instruct-7M-Gen-Mistral-7B. Here is the training hyperparamers.
54
+
55
+ ```bash
56
+ epoch: 3
57
+ lr: 5e-6
58
+ min_lr: 0
59
+ lr_warmup_steps: 40
60
+ lr_decay_style: cosine
61
+ weight_decay: 0.0
62
+ adam_beta1: 0.9
63
+ adam_beta2: 0.95
64
+ global_batch_size: 528
65
+ clip_grad: 1.0
66
+ ```
67
+
68
+ Thanks to [FlagScale](https://github.com/FlagOpen/FlagScale), we could concatenate multiple training samples to remove padding token and apply diverse acceleration techniques to the traning procudure. It effectively reduces our training costs. We will release our code in the near future!
69
+
70
+ ## **Benchmark**
71
+
72
+ | **Model** | **MT-Bench** | **AlpacaEval2.0** | **Arena-hard** |
73
+ |:----------------------------:|:------------:|:-----------------:|:-----------------:|
74
+ | GPT-4-0314 | 9.0 | 35.3 | 50.0 |
75
+ | GPT-4-0613 | 9.2 | 30.2 | 37.9 |
76
+ | GPT-4-1106 | 9.3 | 30.2 | -- |
77
+ | Gemini Pro | -- | 24.4 | 17.8 |
78
+ | Mixtral 8x7B v0.1 | 8.3 | 23.7 | 23.4 |
79
+ | Mistral-7B-Instruct-v0.2 | 7.6 | 17.1 | -- |
80
+ | InfInstruct-3M-0613-Mistral-7B | 8.1 | 25.5 | -- |
81
+ | InfInstruct-3M-0625-Mistral-7B | 8.1 | 31.4 | -- |
82
+ | **InfInstruct-3M-0629-Mistral-7B** | **8.1** | **40.0** | **26.9** |
83
+
84
+ *denote the model is finetuned without reinforcement learning from human feedback (RLHF).
85
+
86
+ ## **How to use**
87
+
88
+ Infinity-Instruct-7M-Gen-Mistral-7B adopt the same chat template of [OpenHermes-2.5-Mistral-7B](https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B):
89
+
90
+ ```bash
91
+ <|im_start|>system
92
+ 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.<|im_end|>
93
+ <|im_start|>user
94
+ Hello!<|im_end|>
95
+ <|im_start|>assistant
96
+ Hi!<|im_end|>
97
+ <|im_start|>user
98
+ How are you?<|im_end|>
99
+ <|im_start|>assistant
100
+ ```
101
+
102
+ To apply this model and template in conversation scenarios, you can refer to the following code:
103
+ ```python
104
+ from transformers import AutoModelForCausalLM, AutoTokenizer, LogitsProcessorList
105
+ import torch
106
+ device = "cuda" # the device to load the model onto
107
+
108
+ model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Mistral-7B",
109
+ torch_dtype=torch.bfloat16,
110
+ device_map="auto"
111
+ )
112
+ tokenizer = AutoTokenizer.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Mistral-7BB")
113
+
114
+ # This template is copied from OpenHermers-mistral-2.5 (https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B)
115
+ prompt = "Give me a short introduction to large language model."
116
+ messages = [
117
+ {"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."},
118
+ {"role": "user", "content": prompt}
119
+ ]
120
+
121
+ text = tokenizer.apply_chat_template(
122
+ messages,
123
+ tokenize=False,
124
+ add_generation_prompt=True
125
+ )
126
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
127
+
128
+ logits_processor = LogitsProcessorList(
129
+ [
130
+ MinLengthLogitsProcessor(1, eos_token_id=tokenizer.eos_token_id),
131
+ TemperatureLogitsWarper(0.7),
132
+ ]
133
+ )
134
+
135
+ generated_ids = model.generate(
136
+ model_inputs.input_ids,
137
+ logits_processor=logits_processor,
138
+ max_new_tokens=512
139
+ )
140
+
141
+ generated_ids = [
142
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
143
+ ]
144
+
145
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
146
+ print(response)
147
+ ```
148
+
149
+
150
+
151
+ ## **Disclaimer**
152
+
153
+ The resources, including code, data, and model weights, associated with this project are restricted for academic research purposes only and cannot be used for commercial purposes. The content produced by any version of Infinity Instruct is influenced by uncontrollable variables such as randomness, and therefore, the accuracy of the output cannot be guaranteed by this project. This project does not accept any legal liability for the content of the model output, nor does it assume responsibility for any losses incurred due to the use of associated resources and output results.
154
+
155
+ ##
156
+
157
+ ## **Citation**
158
+ Our paper, detailing the development and features of the **Infinity Instruct** dataset and finetuned models, will be released soon on arXiv. Stay tuned!
159
+
160
+ ```
161
+ @article{InfinityInstruct2024,
162
+ title={Infinity Instruct},
163
+ author={Beijing Academy of Artificial Intelligence (BAAI)},
164
+ journal={arXiv preprint arXiv:2406.XXXX},
165
+ year={2024}
166
+ }
167
+ ```