Update README.md
Browse files
README.md
CHANGED
@@ -1,75 +1,51 @@
|
|
1 |
---
|
2 |
license: other
|
3 |
-
|
4 |
tags:
|
5 |
- llama-factory
|
6 |
- full
|
7 |
- generated_from_trainer
|
|
|
8 |
model-index:
|
9 |
-
- name:
|
10 |
results: []
|
11 |
---
|
12 |
|
13 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
14 |
-
should probably proofread and complete it, then remove this comment. -->
|
15 |
|
16 |
-
#
|
17 |
|
18 |
-
|
19 |
-
It achieves the following results on the evaluation set:
|
20 |
-
- Loss: 1.0515
|
21 |
|
22 |
-
## Model description
|
23 |
-
|
24 |
-
More information needed
|
25 |
-
|
26 |
-
## Intended uses & limitations
|
27 |
-
|
28 |
-
More information needed
|
29 |
-
|
30 |
-
## Training and evaluation data
|
31 |
-
|
32 |
-
More information needed
|
33 |
-
|
34 |
-
## Training procedure
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
39 |
-
-
|
40 |
-
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
| 0.518 | 2.9431 | 1100 | 1.0516 |
|
68 |
-
|
69 |
-
|
70 |
-
### Framework versions
|
71 |
-
|
72 |
-
- Transformers 4.43.3
|
73 |
-
- Pytorch 2.3.1+cu121
|
74 |
-
- Datasets 2.20.0
|
75 |
-
- Tokenizers 0.19.1
|
|
|
1 |
---
|
2 |
license: other
|
3 |
+
library_name: transformers
|
4 |
tags:
|
5 |
- llama-factory
|
6 |
- full
|
7 |
- generated_from_trainer
|
8 |
+
base_model: hon9kon9ize/CantoneseLLM-v1.0-32B-cpt
|
9 |
model-index:
|
10 |
+
- name: CantoneseLLMChat-v1.0-32B
|
11 |
results: []
|
12 |
---
|
13 |
|
|
|
|
|
14 |
|
15 |
+
# CantoneseLLMChat-v1.0-32B
|
16 |
|
17 |
+

|
|
|
|
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
Cantonese LLM Chat v1.0 is the first generation Cantonese LLM from hon9kon9ize.
|
21 |
+
Building upon the sucess of [v0.5 preview](https://huggingface.co/hon9kon9ize/CantoneseLLMChat-v0.5), the model excels in Hong Kong related specific knowledge and Cantonese conversation.
|
22 |
|
23 |
+
## Model description
|
24 |
+
Base model obtained via Continuous Pre-Training of [Qwen 2.5 32B](https://huggingface.co/Qwen/Qwen2.5-32B) with 600 millions publicaly available Hong Kong news articles and Cantonese websites.
|
25 |
+
Instructions fine-tuned model trained with a dataset consists of 75,000 instrutions pairs. 45,000 pairs were Cantonese insturctions generated by other LLMs and reviewed by humans.
|
26 |
+
|
27 |
+
The model trained with 1 Nvidia H100 80GB HBM3 GPU on [Genkai Supercomputer](https://www.cc.kyushu-u.ac.jp/scp/eng/system/Genkai/hardware/).
|
28 |
+
|
29 |
+
## Basic Usage
|
30 |
+
```
|
31 |
+
import torch
|
32 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
33 |
+
model_id = "hon9kon9ize/CantoneseLLMChat-v1.0-32B"
|
34 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
35 |
+
model = AutoModelForCausalLM.from_pretrained(
|
36 |
+
model_id,
|
37 |
+
torch_dtype=torch.bfloat16,
|
38 |
+
device_map="auto",
|
39 |
+
)
|
40 |
+
def chat(messages, temperature=0.9, max_new_tokens=200):
|
41 |
+
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt').to('cuda:0')
|
42 |
+
output_ids = model.generate(input_ids, max_new_tokens=max_new_tokens, temperature=temperature)
|
43 |
+
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=False)
|
44 |
+
return response
|
45 |
+
prompt = "邊個係香港特首?"
|
46 |
+
messages = [
|
47 |
+
{"role": "system", "content": "you are a helpful assistant."},
|
48 |
+
{"role": "user", "content": prompt}
|
49 |
+
]
|
50 |
+
print(chat(messages)) # 香港特別行政區行政長官係李家超。<|im_end|>
|
51 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|