munish0838
commited on
Commit
•
3ae70df
1
Parent(s):
eaf340c
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
- zh
|
7 |
+
- id
|
8 |
+
- th
|
9 |
+
- vi
|
10 |
+
- ms
|
11 |
+
- lo
|
12 |
+
- my
|
13 |
+
- jv
|
14 |
+
- km
|
15 |
+
- su
|
16 |
+
- tl
|
17 |
+
tags:
|
18 |
+
- multilingual
|
19 |
+
- sea
|
20 |
+
- sailor
|
21 |
+
- sft
|
22 |
+
- chat
|
23 |
+
- instruction
|
24 |
+
widget:
|
25 |
+
- text: 如何制作烤鱼?
|
26 |
+
example_title: Chinese
|
27 |
+
- text: How to bake fish?
|
28 |
+
example_title: English
|
29 |
+
- text: Bagaimana cara memanggang ikan?
|
30 |
+
example_title: Malay
|
31 |
+
- text: วิธีย่างปลา?
|
32 |
+
example_title: Thai
|
33 |
+
- text: Bagaimana membuat bakaran ikan?
|
34 |
+
example_title: Indonesian
|
35 |
+
- text: Làm thế nào để nướng cá?
|
36 |
+
example_title: Vietnamese
|
37 |
+
license: apache-2.0
|
38 |
+
base_model:
|
39 |
+
- sail/Sailor2-1B
|
40 |
+
|
41 |
+
---
|
42 |
+
|
43 |
+
[![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
|
44 |
+
|
45 |
+
|
46 |
+
# QuantFactory/Sailor2-1B-Chat-GGUF
|
47 |
+
This is quantized version of [sail/Sailor2-1B-Chat](https://huggingface.co/sail/Sailor2-1B-Chat) created using llama.cpp
|
48 |
+
|
49 |
+
# Original Model Card
|
50 |
+
|
51 |
+
|
52 |
+
<div align="center">
|
53 |
+
<img src="sailor2_banner.jpg" width="700"/>
|
54 |
+
</div>
|
55 |
+
|
56 |
+
> The logo was generated by MidJourney
|
57 |
+
|
58 |
+
Sailor2 is a community-driven initiative that brings cutting-edge multilingual language models to South-East Asia (SEA).
|
59 |
+
Our research highlights a strong demand for models in the **8B and 20B parameter** range for production use, alongside **1B models** for specialized applications,
|
60 |
+
such as speculative decoding and research purposes.
|
61 |
+
These models, released under the **Apache 2.0 license**, provide enhanced accessibility to advanced language technologies across the region.
|
62 |
+
|
63 |
+
|
64 |
+
Sailor2 builds upon the foundation of the awesome multilingual model [Qwen 2.5](https://huggingface.co/collections/Qwen/qwen25-66e81a666513e518adb90d9e) and
|
65 |
+
is continuously pre-trained on **500B tokens** to support **15 languages** better with a unified model.
|
66 |
+
These languages include English, Chinese, Burmese, Cebuano, Ilocano, Indonesian, Javanese, Khmer, Lao, Malay, Sundanese, Tagalog, Thai, Vietnamese, and Waray.
|
67 |
+
By addressing the growing demand for diverse, robust, and accessible language models, Sailor2 seeks to serve the underserved in SEA areas with open, inclusive, and accessible multilingual LLMs.
|
68 |
+
The Sailor2 model comes in three sizes, 1B, 8B, and 20B, which are **expanded from the Qwen2.5 base models** of 0.5B, 7B, and 14B, respectively.
|
69 |
+
|
70 |
+
## Model Summary
|
71 |
+
- **Model Collections:** [Base Model & Chat Model](https://huggingface.co/collections/sail/sailor2-language-models-674d7c9e6b4dbbd9a869906b)
|
72 |
+
- **Project Website:** [sea-sailor.github.io/blog/sailor2/](https://sea-sailor.github.io/blog/sailor2/)
|
73 |
+
- **Codebase:** [github.com/sail-sg/sailor2](https://github.com/sail-sg/sailor2)
|
74 |
+
- **Technical Report:** Coming Soon
|
75 |
+
|
76 |
+
|
77 |
+
## Training details
|
78 |
+
|
79 |
+
During development, we employ a range of advanced technologies to ensure top-tier performance and efficiency:
|
80 |
+
|
81 |
+
1. model expansion
|
82 |
+
2. optimized data mixing strategies
|
83 |
+
3. multi-stage pre-training protocols
|
84 |
+
4. advanced multilingual post-training
|
85 |
+
|
86 |
+
Please refer to [Sailor2 Blog](https://sea-sailor.github.io/blog/sailor2/) for more training details.
|
87 |
+
|
88 |
+
|
89 |
+
## Requirements
|
90 |
+
The code of Sailor2 has been in the latest Hugging face transformers and we advise you to install `transformers==4.46.3`.
|
91 |
+
|
92 |
+
## Quickstart
|
93 |
+
|
94 |
+
Here provides a code snippet to show you how to load the tokenizer and model and how to generate contents.
|
95 |
+
|
96 |
+
```python
|
97 |
+
import torch
|
98 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
99 |
+
device = "cuda"
|
100 |
+
|
101 |
+
model = AutoModelForCausalLM.from_pretrained(
|
102 |
+
'sail/Sailor2-1B-Chat',
|
103 |
+
torch_dtype=torch.bfloat16,
|
104 |
+
device_map="auto"
|
105 |
+
)
|
106 |
+
|
107 |
+
tokenizer = AutoTokenizer.from_pretrained('sail/Sailor2-20B-Chat')
|
108 |
+
system_prompt= \
|
109 |
+
'You are an AI assistant named Sailor2, created by Sea AI Lab. \
|
110 |
+
As an AI assistant, you can answer questions in English, Chinese, and Southeast Asian languages \
|
111 |
+
such as Burmese, Cebuano, Ilocano, Indonesian, Javanese, Khmer, Lao, Malay, Sundanese, Tagalog, Thai, Vietnamese, and Waray. \
|
112 |
+
Your responses should be friendly, unbiased, informative, detailed, and faithful.'
|
113 |
+
|
114 |
+
prompt = "Beri saya pengenalan singkat tentang model bahasa besar."
|
115 |
+
# prompt = "Hãy cho tôi một giới thiệu ngắn gọn về mô hình ngôn ngữ lớn."
|
116 |
+
# prompt = "ให้ฉันแนะนำสั้น ๆ เกี่ยวกับโมเดลภาษาขนาดใหญ่"
|
117 |
+
|
118 |
+
messages = [
|
119 |
+
{"role": "system", "content": system_prompt},
|
120 |
+
{"role": "user", "content": prompt}
|
121 |
+
]
|
122 |
+
text = tokenizer.apply_chat_template(
|
123 |
+
messages,
|
124 |
+
tokenize=False,
|
125 |
+
add_generation_prompt=True
|
126 |
+
)
|
127 |
+
|
128 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
129 |
+
input_ids = model_inputs.input_ids.to(device)
|
130 |
+
|
131 |
+
generated_ids = model.generate(
|
132 |
+
input_ids,
|
133 |
+
max_new_tokens=512,
|
134 |
+
)
|
135 |
+
|
136 |
+
generated_ids = [
|
137 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
138 |
+
]
|
139 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
140 |
+
print(response)
|
141 |
+
```
|
142 |
+
|
143 |
+
# License
|
144 |
+
|
145 |
+
Sailor2 is distributed under the terms of the Apache License 2.0.
|
146 |
+
No restrict on the research and the commercial use.
|
147 |
+
|
148 |
+
## Citation
|
149 |
+
|
150 |
+
If you find Sailor2 useful, please cite our work as follows:
|
151 |
+
|
152 |
+
```
|
153 |
+
@misc{sailor2report,
|
154 |
+
title={Sailor2: Sailing in South-East Asia with Inclusive Multilingual LLM},
|
155 |
+
author={Sailor2 Team},
|
156 |
+
year={2024}
|
157 |
+
}
|
158 |
+
```
|
159 |
+
|
160 |
+
# Contact Us
|
161 |
+
|
162 |
+
If you have any questions, please raise an issue or contact us at [[email protected]](mailto:[email protected]) or [[email protected]](mailto:[email protected]).
|