Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| Sailor-1.8B-Chat.Q2_K.gguf | Q2_K | 0.79GB |
| Sailor-1.8B-Chat.Q3_K_S.gguf | Q3_K_S | 0.89GB |
| Sailor-1.8B-Chat.Q3_K.gguf | Q3_K | 0.95GB |
| Sailor-1.8B-Chat.Q3_K_M.gguf | Q3_K_M | 0.95GB |
| Sailor-1.8B-Chat.Q3_K_L.gguf | Q3_K_L | 0.98GB |
| Sailor-1.8B-Chat.IQ4_XS.gguf | IQ4_XS | 1.01GB |
| Sailor-1.8B-Chat.Q4_0.gguf | Q4_0 | 1.04GB |
| Sailor-1.8B-Chat.IQ4_NL.gguf | IQ4_NL | 1.05GB |
| Sailor-1.8B-Chat.Q4_K_S.gguf | Q4_K_S | 1.08GB |
| Sailor-1.8B-Chat.Q4_K.gguf | Q4_K | 1.13GB |
| Sailor-1.8B-Chat.Q4_K_M.gguf | Q4_K_M | 1.13GB |
| Sailor-1.8B-Chat.Q4_1.gguf | Q4_1 | 1.13GB |
| Sailor-1.8B-Chat.Q5_0.gguf | Q5_0 | 1.22GB |
| Sailor-1.8B-Chat.Q5_K_S.gguf | Q5_K_S | 1.24GB |
| Sailor-1.8B-Chat.Q5_K.gguf | Q5_K | 1.28GB |
| Sailor-1.8B-Chat.Q5_K_M.gguf | Q5_K_M | 1.28GB |
| Sailor-1.8B-Chat.Q5_1.gguf | Q5_1 | 1.31GB |
| Sailor-1.8B-Chat.Q6_K.gguf | Q6_K | 1.47GB |
| Sailor-1.8B-Chat.Q8_0.gguf | Q8_0 | 1.82GB |

The logo was generated by MidJourney
transformers>=4.37.0.1from transformers import AutoModelForCausalLM, AutoTokenizer
2device = "cuda"
3
4model = AutoModelForCausalLM.from_pretrained(
5 'sail/Sailor-1.8B-Chat',
6 torch_dtype="auto",
7 device_map="auto"
8)
9
10tokenizer = AutoTokenizer.from_pretrained('sail/Sailor-1.8B-Chat')
11system_prompt= 'You are a helpful assistant'
12
13prompt = "Beri saya pengenalan singkat tentang model bahasa besar."
14# 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."
15# prompt = "ให้ฉันแนะนำสั้น ๆ เกี่ยวกับโมเดลภาษาขนาดใหญ่"
16
17messages = [
18 {"role": "system", "content": system_prompt},
19 {"role": "question", "content": prompt}
20]
21text = tokenizer.apply_chat_template(
22 messages,
23 tokenize=False,
24 add_generation_prompt=True
25)
26
27model_inputs = tokenizer([text], return_tensors="pt").to(device)
28input_ids = model_inputs.input_ids.to(device)
29
30generated_ids = model.generate(
31 input_ids,
32 max_new_tokens=512,
33)
34
35generated_ids = [
36 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
37]
38response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
39print(response)@article{dou2024sailor,
title={Sailor: Open Language Models for South-East Asia},
author={Dou, Longxu and Liu, Qian and Zeng, Guangtao and Guo, Jia and Zhou, Jiahui and Lu, Wei and Lin, Min},
journal={arXiv preprint arXiv:2404.03608},
year={2024}
}