benchang1110
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,72 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
2 |
library_name: transformers
|
3 |
-
tags: []
|
4 |
---
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
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 |
-
|
68 |
-
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
+
datasets:
|
3 |
+
- benchang1110/Guanaco-Taide
|
4 |
+
- benchang1110/TaiwanChat-Taide
|
5 |
+
- benchang1110/Belle-Taide
|
6 |
+
- benchang1110/ChatTaiwan
|
7 |
library_name: transformers
|
|
|
8 |
---
|
9 |
|
10 |
+
## Model Card for Model ID
|
11 |
+
|
12 |
+
This model is the instruction finetuning version of [benchang1110/SmolLM-135M-Taiwan](https://huggingface.co/benchang1110/SmolLM-135M-Taiwan).
|
13 |
+
|
14 |
+
## Usage
|
15 |
+
```python
|
16 |
+
import torch, transformers
|
17 |
+
def generate_response():
|
18 |
+
model = transformers.AutoModelForCausalLM.from_pretrained("benchang1110/SmolLM-135M-Taiwan-Instruct-v0.1").to(device)
|
19 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained("benchang1110/SmolLM-135M-Taiwan-Instruct-v0.1")
|
20 |
+
streamer = transformers.TextStreamer(tokenizer,skip_prompt=True)
|
21 |
+
while(1):
|
22 |
+
prompt = input('USER:')
|
23 |
+
if prompt == "exit":
|
24 |
+
break
|
25 |
+
print("Assistant: ")
|
26 |
+
message = [
|
27 |
+
{'content': prompt, 'role': 'user'},
|
28 |
+
]
|
29 |
+
formatted_chat = tokenizer.apply_chat_template(message,tokenize=True,add_generation_prompt=True,return_tensors='pt').to(device)
|
30 |
+
_ = model.generate(formatted_chat,streamer=streamer,use_cache=True,max_new_tokens=1024,do_sample=True)
|
31 |
+
|
32 |
+
if __name__ == '__main__':
|
33 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
34 |
+
generate_response()
|
35 |
+
```
|
36 |
+
|
37 |
+
|
38 |
+
## Example
|
39 |
+
```
|
40 |
+
<|im_start|>user
|
41 |
+
寫一首詩<|im_end|>
|
42 |
+
<|im_start|>assistant
|
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 |
+
我是台灣,美麗而多元的一部分,
|
68 |
+
我驕傲地稱你為家,
|
69 |
+
你是我心中的旅伴,我愛你,
|
70 |
+
台灣,我愛你,
|
71 |
+
我將永遠熱愛你,我的家。<|im_end|>
|
72 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|