Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: tongyi-qianwen
|
4 |
+
license_link: https://huggingface.co/Qwen/Qwen1.5-72B/blob/main/LICENSE
|
5 |
+
language:
|
6 |
+
- th
|
7 |
+
- en
|
8 |
+
pipeline_tag: text-generation
|
9 |
+
---
|
10 |
+
**Typhoon-v1.5-72B-instruct: Thai Large Language Model (Instruct)**
|
11 |
+
|
12 |
+
**Typhoon-v1.5-72B-instruct** is a *instruct* Thai 🇹🇭 large language model with 72 billion parameters, and it is based on Qwen1.5-72B.
|
13 |
+
|
14 |
+
![Typhoon 1.5 72B benchmark](https://storage.googleapis.com/typhoon-public/assets/1.5-72b-benchmark.png)
|
15 |
+
|
16 |
+
For release post, please see our blog.
|
17 |
+
|
18 |
+
## **Model Description**
|
19 |
+
|
20 |
+
- **Model type**: A 72B instruct decoder-only model based on Qwen1.5 archtecture.
|
21 |
+
- **Requirement**: transformers 4.38.0 or newer.
|
22 |
+
- **Primary Language(s)**: Thai 🇹🇭 and English 🇬🇧
|
23 |
+
- **License**: [Qwen License](https://huggingface.co/Qwen/Qwen1.5-72B/raw/main/LICENSE)
|
24 |
+
|
25 |
+
## **Performance**
|
26 |
+
|
27 |
+
| Model | ONET | IC | TGAT | TPAT-1 | A-Level | Average (ThaiExam) | M3Exam | MMLU |
|
28 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
29 |
+
| Typhoon-1.5 72B | 0.562 | 0.716 | 0.778 | 0.5 | 0.528 | 0.6168 | 0.587 | 0.7271 |
|
30 |
+
| OpenThaiGPT 1.0.0b 70B | 0.447 | 0.492 | 0.778 | 0.5 | 0.319 | 0.5072 | 0.493 | 0.6167 |
|
31 |
+
| GPT-3.5-turbo(01-2024) | 0.358 | 0.279 | 0.678 | 0.345 | 0.318 | 0.3956 | 0.316 | 0.700** |
|
32 |
+
| GPT-4(04-2024) | 0.589 | 0.594 | 0.756 | 0.517 | 0.616 | 0.6144 | 0.626 | 0.864** |
|
33 |
+
|
34 |
+
## Usage Example
|
35 |
+
|
36 |
+
```python
|
37 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
38 |
+
import torch
|
39 |
+
|
40 |
+
model_id = "scb10x/typhoon-v1.5-72b-instruct"
|
41 |
+
|
42 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
43 |
+
model = AutoModelForCausalLM.from_pretrained(
|
44 |
+
model_id,
|
45 |
+
torch_dtype=torch.bfloat16,
|
46 |
+
device_map="auto",
|
47 |
+
)
|
48 |
+
|
49 |
+
messages = [
|
50 |
+
{"role": "system", "content": "You are a helpful assistant who're always speak Thai."},
|
51 |
+
{"role": "user", "content": "ขอสูตรไก่ย่าง"},
|
52 |
+
]
|
53 |
+
|
54 |
+
input_ids = tokenizer.apply_chat_template(
|
55 |
+
messages,
|
56 |
+
add_generation_prompt=True,
|
57 |
+
return_tensors="pt"
|
58 |
+
).to(model.device)
|
59 |
+
|
60 |
+
outputs = model.generate(
|
61 |
+
input_ids,
|
62 |
+
max_new_tokens=512,
|
63 |
+
do_sample=True,
|
64 |
+
temperature=0.4,
|
65 |
+
top_p=0.9,
|
66 |
+
)
|
67 |
+
response = outputs[0][input_ids.shape[-1]:]
|
68 |
+
print(tokenizer.decode(response, skip_special_tokens=True))
|
69 |
+
```
|
70 |
+
|
71 |
+
## Chat Template
|
72 |
+
|
73 |
+
We use chatml chat-template.
|
74 |
+
|
75 |
+
```python
|
76 |
+
{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content']}}{% if (loop.last and add_generation_prompt) or not loop.last %}{{ '<|im_end|>' + '\n'}}{% endif %}{% endfor %}
|
77 |
+
{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{ '<|im_start|>assistant\n' }}{% endif %}
|
78 |
+
```
|
79 |
+
|
80 |
+
## **Intended Uses & Limitations**
|
81 |
+
|
82 |
+
This model is an instructional model. However, it’s still undergoing development. It incorporates some level of guardrails, but it still may produce answers that are inaccurate, biased, or otherwise objectionable in response to user prompts. We recommend that developers assess these risks in the context of their use case.
|
83 |
+
|
84 |
+
## **Follow us**
|
85 |
+
|
86 |
+
**https://twitter.com/opentyphoon**
|
87 |
+
|
88 |
+
## **Support / Ask any question**
|
89 |
+
|
90 |
+
**https://discord.gg/CqyBscMFpg**
|
91 |
+
|
92 |
+
## **SCB10X AI Team**
|
93 |
+
|
94 |
+
- Kunat Pipatanakul, Potsawee Manakul, Sittipong Sripaisarnmongkol, Pathomporn Chokchainant, Kasima Tharnpipitchai
|
95 |
+
- If you find Typhoon-8B useful for your work, please cite it using:
|
96 |
+
|
97 |
+
```
|
98 |
+
@article{pipatanakul2023typhoon,
|
99 |
+
title={Typhoon: Thai Large Language Models},
|
100 |
+
author={Kunat Pipatanakul and Phatrasek Jirabovonvisut and Potsawee Manakul and Sittipong Sripaisarnmongkol and Ruangsak Patomwong and Pathomporn Chokchainant and Kasima Tharnpipitchai},
|
101 |
+
year={2023},
|
102 |
+
journal={arXiv preprint arXiv:2312.13951},
|
103 |
+
url={https://arxiv.org/abs/2312.13951}
|
104 |
+
}
|
105 |
+
```
|
106 |
+
|
107 |
+
## **Contact Us**
|
108 |
+
|
109 |
+
- General & Collaboration: **[kasima@scb10x.com](mailto:kasima@scb10x.com)**, **[pathomporn@scb10x.com](mailto:pathomporn@scb10x.com)**
|
110 |
+
- Technical: **[kunat@scb10x.com](mailto:kunat@scb10x.com)**
|