GGUF
English
conversational
aashish1904 commited on
Commit
2756712
Β·
verified Β·
1 Parent(s): ffd9512

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +159 -0
README.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: llama3.1
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-Llama3_1-8B-GGUF
15
+ This is quantized version of [BAAI/Infinity-Instruct-7M-Gen-Llama3_1-8B](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-8B) 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-Llama3.1-8B 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 GPT4.
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-8B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Llama3-8B), 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-8B 0613](https://huggingface.co/BAAI/Infinity-Instruct-3M-0613-Llama3-8B). 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-Llama3.1-8B 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 Llama3-8B, and get the foundational instruct model Infinity-Instruct-7M-Llama3.1-8B. Then we finetune the Infinity-Instruct-7M-Llama3.1-8B to get the stronger chat model Infinity-Instruct-7M-Gen-Llama3.1-8B. 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
+ | Llama-3-8B-Instruct | 9.0 | 34.4 | 46.6 |
78
+ | Llama-3.1-8B-Instruct | -- | 20.9 | 20.6 |
79
+ | **InfInstruct-7M-Llama-3.1-8B** | **8.2** | **33.9** | **30.4** |
80
+
81
+ *denote the model is finetuned without reinforcement learning from human feedback (RLHF).
82
+
83
+ ## **How to use**
84
+
85
+ Infinity-Instruct-7M-Gen-Llama3.1-8B adopt the same chat template of [Llama3-8B-instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct):
86
+
87
+ ```bash
88
+ <|begin_of_text|><|start_header_id|>user<|end_header_id|>
89
+
90
+ How are you?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
91
+
92
+ Hi!<|eot_id|><|start_header_id|>user<|end_header_id|>
93
+
94
+ How are you?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
95
+ ```
96
+
97
+ To apply this model and template in conversation scenarios, you can refer to the following code:
98
+
99
+ ```python
100
+ from transformers import AutoModelForCausalLM, AutoTokenizer, LogitsProcessorList
101
+ import torch
102
+ device = "cuda" # the device to load the model onto
103
+
104
+ model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Llama3_1-8B",
105
+ torch_dtype=torch.bfloat16,
106
+ device_map="auto"
107
+ )
108
+ tokenizer = AutoTokenizer.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Llama3_1-8B")
109
+
110
+ prompt = "Give me a short introduction to large language model."
111
+ messages = [
112
+ {"role": "user", "content": prompt}
113
+ ]
114
+
115
+ text = tokenizer.apply_chat_template(
116
+ messages,
117
+ tokenize=False,
118
+ add_generation_prompt=True
119
+ )
120
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
121
+
122
+ logits_processor = LogitsProcessorList(
123
+ [
124
+ MinLengthLogitsProcessor(1, eos_token_id=tokenizer.eos_token_id),
125
+ TemperatureLogitsWarper(0.7),
126
+ ]
127
+ )
128
+
129
+ generated_ids = model.generate(
130
+ model_inputs.input_ids,
131
+ logits_processor=logits_processor,
132
+ max_new_tokens=512
133
+ )
134
+
135
+ generated_ids = [
136
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
137
+ ]
138
+
139
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
140
+ print(response)
141
+ ```
142
+
143
+ ## **Disclaimer**
144
+
145
+ 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.
146
+
147
+ ##
148
+
149
+ ## **Citation**
150
+ Our paper, detailing the development and features of the **Infinity Instruct** dataset and finetuned models, will be released soon on arXiv. Stay tuned!
151
+
152
+ ```
153
+ @article{InfinityInstruct2024,
154
+ title={Infinity Instruct},
155
+ author={Beijing Academy of Artificial Intelligence (BAAI)},
156
+ journal={arXiv preprint arXiv:2406.XXXX},
157
+ year={2024}
158
+ }
159
+ ```