gamepollakrit commited on
Commit
cc84426
·
verified ·
1 Parent(s): 4f07ac5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -2
README.md CHANGED
@@ -2,6 +2,63 @@
2
  {}
3
  ---
4
 
5
- # TSUNAMI: Transformative Semantic Understanding and Natural Augmentation Model for Intelligence
6
 
7
- **TSUNAMI** full name Created by ChatGPT
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  {}
3
  ---
4
 
5
+ <img src="./Tsunami.webp" alt="Tsunami Model" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
6
 
7
+ # Tsunami-7B-Instruct
8
+ **TSUNAMI**: Transformative Semantic Understanding and Natural Augmentation Model for Intelligence.
9
+
10
+ **TSUNAMI** full name was created by ChatGPT.
11
+
12
+ ---
13
+
14
+ ### infomation
15
+ **Tsunami-7B-Instruct** is Thai Large Language Model that fine-tuned from **Qwen2.5-7B** around 60,000 rows in Thai-specific domain.
16
+
17
+ ---
18
+
19
+ ### Prompt Template
20
+
21
+ This model uses `ChatML` prompt template:
22
+
23
+ ```
24
+ <|im_start|>system
25
+ {System}<|im_end|>
26
+ <|im_start|>user
27
+ {User}<|im_end|>
28
+ <|im_start|>assistant
29
+ {Assistant}
30
+ ````
31
+
32
+ ### How to use
33
+
34
+
35
+ ```python
36
+
37
+ from transformers import AutoModelForCausalLM, AutoTokenizer
38
+
39
+ model_name = "Tsunami/Tsunami-0.5-7B-Instruct"
40
+
41
+ model = AutoModelForCausalLM.from_pretrained(
42
+ model_name,
43
+ torch_dtype="auto",
44
+ device_map="auto"
45
+ )
46
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
47
+
48
+ messages = [
49
+ {"role": "system", "content": "You are a helpful assistant."},
50
+ {"role": "user", "content": "สวัสดีครับ"}
51
+ ]
52
+ text = tokenizer.apply_chat_template(
53
+ messages,
54
+ tokenize=False,
55
+ add_generation_prompt=True
56
+ )
57
+
58
+ inputs = tokenizer(text, return_tensors="pt")
59
+ inputs = inputs.to(model.device)
60
+ with torch.no_grad():
61
+ output = model.generate(**inputs, max_new_tokens=512)
62
+
63
+ response = tokenizer.decode(output[0, len(inputs['input_ids'][0]):], skip_special_tokens=True)
64
+ ```