RichardErkhov commited on
Commit
f369bee
·
verified ·
1 Parent(s): 219371c

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +247 -0
README.md ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ Sailor-1.8B - bnb 4bits
11
+ - Model creator: https://huggingface.co/sail/
12
+ - Original model: https://huggingface.co/sail/Sailor-1.8B/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ language:
20
+ - en
21
+ - zh
22
+ - id
23
+ - th
24
+ - vi
25
+ - ms
26
+ - lo
27
+ datasets:
28
+ - cerebras/SlimPajama-627B
29
+ - Skywork/SkyPile-150B
30
+ - allenai/MADLAD-400
31
+ - cc100
32
+ tags:
33
+ - multilingual
34
+ - sea
35
+ - sailor
36
+ license: apache-2.0
37
+ base_model: Qwen/Qwen1.5-1.8B
38
+ inference: false
39
+ model-index:
40
+ - name: Sailor-1.8B
41
+ results:
42
+ - task:
43
+ type: text-generation
44
+ dataset:
45
+ name: XQuAD-Thai
46
+ type: XQuAD-Thai
47
+ metrics:
48
+ - name: EM (3-Shot)
49
+ type: EM (3-Shot)
50
+ value: 32.72
51
+ - name: F1 (3-Shot)
52
+ type: F1 (3-Shot)
53
+ value: 48.66
54
+ - task:
55
+ type: text-generation
56
+ dataset:
57
+ name: TyDiQA-Indonesian
58
+ type: TyDiQA-Indonesian
59
+ metrics:
60
+ - name: EM (3-Shot)
61
+ type: EM (3-Shot)
62
+ value: 40.88
63
+ - name: F1 (3-Shot)
64
+ type: F1 (3-Shot)
65
+ value: 65.37
66
+ - task:
67
+ type: text-generation
68
+ dataset:
69
+ name: XQuAD-Vietnamese
70
+ type: XQuAD-Vietnamese
71
+ metrics:
72
+ - name: EM (3-Shot)
73
+ type: EM (3-Shot)
74
+ value: 34.22
75
+ - name: F1 (3-Shot)
76
+ type: F1 (3-Shot)
77
+ value: 53.35
78
+ - task:
79
+ type: text-generation
80
+ dataset:
81
+ name: XCOPA-Thai
82
+ type: XCOPA-Thai
83
+ metrics:
84
+ - name: EM (3-Shot)
85
+ type: EM (3-Shot)
86
+ value: 53.8
87
+ - task:
88
+ type: text-generation
89
+ dataset:
90
+ name: XCOPA-Indonesian
91
+ type: XCOPA-Indonesian
92
+ metrics:
93
+ - name: EM (3-Shot)
94
+ type: EM (3-Shot)
95
+ value: 64.20
96
+ - task:
97
+ type: text-generation
98
+ dataset:
99
+ name: XCOPA-Vietnamese
100
+ type: XCOPA-Vietnamese
101
+ metrics:
102
+ - name: EM (3-Shot)
103
+ type: EM (3-Shot)
104
+ value: 63.20
105
+ - task:
106
+ type: text-generation
107
+ dataset:
108
+ name: M3Exam-Thai
109
+ type: M3Exam-Thai
110
+ metrics:
111
+ - name: EM (3-Shot)
112
+ type: EM (3-Shot)
113
+ value: 25.38
114
+ - task:
115
+ type: text-generation
116
+ dataset:
117
+ name: M3Exam-Indonesian
118
+ type: M3Exam-Indonesian
119
+ metrics:
120
+ - name: EM (3-Shot)
121
+ type: EM (3-Shot)
122
+ value: 28.30
123
+ - task:
124
+ type: text-generation
125
+ dataset:
126
+ name: M3Exam-Vietnamese
127
+ type: M3Exam-Vietnamese
128
+ metrics:
129
+ - name: EM (3-Shot)
130
+ type: EM (3-Shot)
131
+ value: 34.71
132
+ - task:
133
+ type: text-generation
134
+ dataset:
135
+ name: BELEBELE-Thai
136
+ type: BELEBELE-Thai
137
+ metrics:
138
+ - name: EM (3-Shot)
139
+ type: EM (3-Shot)
140
+ value: 34.22
141
+ - task:
142
+ type: text-generation
143
+ dataset:
144
+ name: BELEBELE-Indonesian
145
+ type: BELEBELE-Indonesian
146
+ metrics:
147
+ - name: EM (3-Shot)
148
+ type: EM (3-Shot)
149
+ value: 34.89
150
+ - task:
151
+ type: text-generation
152
+ dataset:
153
+ name: BELEBELE-Vietnamese
154
+ type: BELEBELE-Vietnamese
155
+ metrics:
156
+ - name: EM (3-Shot)
157
+ type: EM (3-Shot)
158
+ value: 35.33
159
+ ---
160
+
161
+ <div align="center">
162
+ <img src="banner_sailor.jpg" width="700"/>
163
+ </div>
164
+
165
+ Sailor is a suite of Open Language Models tailored for South-East Asia (SEA), focusing on languages such as 🇮🇩Indonesian, 🇹🇭Thai, 🇻🇳Vietnamese, 🇲🇾Malay, and 🇱🇦Lao.
166
+ Developed with careful data curation, Sailor models are designed to understand and generate text across diverse linguistic landscapes of SEA region.
167
+ Built from [Qwen 1.5](https://huggingface.co/collections/Qwen/qwen15-65c0a2f577b1ecb76d786524) , Sailor encompasses models of varying sizes, spanning from 0.5B to 7B versions for different requirements.
168
+ We further fine-tune the base model with open-source datasets to get instruction-tuned models, namedly Sailor-Chat.
169
+ Benchmarking results demonstrate Sailor's proficiency in tasks such as question answering, commonsense reasoning, and other tasks in SEA languages.
170
+
171
+ > The logo was generated by MidJourney
172
+
173
+ ## Model Summary
174
+ - **Model Collections:** [Base Model & Chat Model](https://huggingface.co/collections/sail/sailor-65e19a749f978976f1959825)
175
+ - **Project Website:** [sailorllm.github.io](https://sailorllm.github.io/)
176
+ - **Codebase:** [github.com/sail-sg/sailor-llm](https://github.com/sail-sg/sailor-llm)
177
+ - **Technical Report:** [arxiv.org/pdf/2404.03608.pdf](https://arxiv.org/pdf/2404.03608.pdf)
178
+
179
+
180
+ ## Training details
181
+ Sailor is crafted by continually pre-training from language models like the remarkable Qwen 1.5 models, which already has a great performance on SEA languages.
182
+ The pre-training corpus heavily leverages the publicly available corpus, including
183
+ [SlimPajama](https://huggingface.co/datasets/cerebras/SlimPajama-627B),
184
+ [SkyPile](https://huggingface.co/datasets/Skywork/SkyPile-150B),
185
+ [CC100](https://huggingface.co/datasets/cc100) and [MADLAD-400](https://huggingface.co/datasets/allenai/MADLAD-400).
186
+
187
+ By employing aggressive data deduplication and careful data cleaning on the collected corpus, we have attained a high-quality dataset spanning various languages.
188
+ Through systematic experiments to determine the weights of different languages, Sailor models undergo training from 200B to 400B tokens, tailored to different model sizes.
189
+ The approach boosts their performance on SEA languages while maintaining proficiency in English and Chinese without significant compromise.
190
+ Finally, we continually pre-train the Qwen1.5-0.5B model with 400 Billion tokens, and other models with 200 Billion tokens to obtain the Sailor models.
191
+
192
+ ## Requirements
193
+ The code of Sailor has been in the latest Hugging face transformers and we advise you to install `transformers>=4.37.0`.
194
+
195
+ ## Quickstart
196
+
197
+ Here provides a code snippet to show you how to load the tokenizer and model and how to generate contents.
198
+
199
+ ```python
200
+ from transformers import AutoModelForCausalLM, AutoTokenizer
201
+ device = "cuda" # the device to load the model
202
+
203
+ model = AutoModelForCausalLM.from_pretrained("sail/Sailor-1.8B", device_map="auto")
204
+ tokenizer = AutoTokenizer.from_pretrained("sail/Sailor-1.8B")
205
+
206
+ input_message = "Model bahasa adalah model probabilistik"
207
+ ### The given Indonesian input translates to 'A language model is a probabilistic model of.'
208
+
209
+ model_inputs = tokenizer([input_message], return_tensors="pt").to(device)
210
+
211
+ generated_ids = model.generate(
212
+ model_inputs.input_ids,
213
+ max_new_tokens=64
214
+ )
215
+
216
+ generated_ids = [
217
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
218
+ ]
219
+
220
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
221
+ print(response)
222
+ ```
223
+
224
+ # License
225
+
226
+ Sailor is distributed under the terms of the Apache License 2.0.
227
+ No restrict on the research and the commercial use, but should comply with the [Qwen License](https://huggingface.co/Qwen/Qwen1.5-1.8B/blob/main/LICENSE).
228
+
229
+ ## Citation
230
+
231
+ If you find sailor useful, please cite our work as follows:
232
+
233
+ ```
234
+ @misc{dou2024sailor,
235
+ title={Sailor: Open Language Models for South-East Asia},
236
+ author={Longxu Dou and Qian Liu and Guangtao Zeng and Jia Guo and Jiahui Zhou and Wei Lu and Min Lin},
237
+ year={2024},
238
+ eprint={2404.03608},
239
+ archivePrefix={arXiv},
240
+ primaryClass={cs.CL}
241
+ }
242
+ ```
243
+
244
+ # Contact Us
245
+
246
+ If you have any questions, please raise an issue or contact us at [[email protected]](mailto:[email protected]) or [[email protected]](mailto:[email protected]).
247
+