gamepollakrit
commited on
Commit
•
b8e3c96
1
Parent(s):
60b97d4
Update README.md
Browse files
README.md
CHANGED
@@ -1,49 +1,82 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
2 |
base_model:
|
|
|
3 |
- Qwen/Qwen2.5-7B
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
---
|
10 |
-
# Butler-0.7xa.6-7B-beta-Instruct
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
This model was merged using the [TIES](https://arxiv.org/abs/2306.01708) merge method using [Qwen/Qwen2.5-7B](https://huggingface.co/Qwen/Qwen2.5-7B) as a base.
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
* ../model_collection/7B-SFT-merge/Butler-0.7x.6-7B-mrg-Instruct
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
density: 1
|
36 |
-
weight: 1
|
37 |
-
- model: ../model_collection/7B-SFT-merge/Butler-0.7x.6-7B-mrg-Instruct
|
38 |
-
parameters:
|
39 |
-
density: 1
|
40 |
-
weight: 1
|
41 |
-
merge_method: ties
|
42 |
-
base_model: Qwen/Qwen2.5-7B
|
43 |
-
dtype: bfloat16
|
44 |
-
parameters:
|
45 |
-
normalize: true
|
46 |
-
weight: 1
|
47 |
-
density: 1
|
48 |
|
|
|
49 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- th
|
4 |
+
- en
|
5 |
+
library_name: transformers
|
6 |
base_model:
|
7 |
+
- Qwen/Qwen2.5-7B-Instruct
|
8 |
- Qwen/Qwen2.5-7B
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
---
|
11 |
+
|
12 |
+
<img src="./Tsunami.webp" alt="Tsunami Model" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
13 |
+
|
14 |
+
# Tsunami-0.5x-7B-Instruct
|
15 |
+
**TSUNAMI**: Transformative Semantic Understanding and Natural Augmentation Model for Intelligence.
|
16 |
+
|
17 |
+
**TSUNAMI** full name was created by ChatGPT.
|
18 |
+
|
19 |
+
---
|
20 |
+
|
21 |
+
### infomation
|
22 |
+
**Tsunami-0.5x-7B-Instruct** is Thai Large Language Model that fine-tuned from **Qwen2.5-7B** around **100,000** rows in Thai-specific domain.
|
23 |
|
24 |
---
|
|
|
25 |
|
26 |
+
### Prompt Template
|
27 |
|
28 |
+
This model uses `ChatML` prompt template:
|
29 |
+
|
30 |
+
```
|
31 |
+
<|im_start|>system
|
32 |
+
{System}<|im_end|>
|
33 |
+
<|im_start|>user
|
34 |
+
{User}<|im_end|>
|
35 |
+
<|im_start|>assistant
|
36 |
+
{Assistant}
|
37 |
+
````
|
38 |
+
|
39 |
+
### How to use
|
40 |
|
|
|
41 |
|
42 |
+
```python
|
43 |
|
44 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
45 |
+
import torch
|
|
|
46 |
|
47 |
+
model_name = "Tsunami-th/Tsunami-0.5x-7B-Instruct"
|
48 |
|
49 |
+
model = AutoModelForCausalLM.from_pretrained(
|
50 |
+
model_name,
|
51 |
+
torch_dtype="auto",
|
52 |
+
device_map="auto"
|
53 |
+
)
|
54 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
55 |
|
56 |
+
messages = [
|
57 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
58 |
+
{"role": "user", "content": "สวัสดีครับ"}
|
59 |
+
]
|
60 |
+
text = tokenizer.apply_chat_template(
|
61 |
+
messages,
|
62 |
+
tokenize=False,
|
63 |
+
add_generation_prompt=True
|
64 |
+
)
|
65 |
|
66 |
+
inputs = tokenizer(text, return_tensors="pt")
|
67 |
+
inputs = inputs.to(model.device)
|
68 |
+
with torch.no_grad():
|
69 |
+
output = model.generate(**inputs, max_new_tokens=512)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
+
response = tokenizer.decode(output[0, len(inputs['input_ids'][0]):], skip_special_tokens=True)
|
72 |
```
|
73 |
+
|
74 |
+
---
|
75 |
+
|
76 |
+
### Author
|
77 |
+
- Pollakrit Lorprasertkul | [email protected]
|
78 |
+
|
79 |
+
---
|
80 |
+
|
81 |
+
- **Tsunami-0.5x-7B-Instruct** is the version 0.5x that did not train on the whole dataset.
|
82 |
+
- **Tsunami-1.0-7B-Instruct** is coming soon.
|