robinsmits
commited on
Commit
•
e0ffa30
1
Parent(s):
bc6d654
Update README.md
Browse files
README.md
CHANGED
@@ -13,199 +13,111 @@ pipeline_tag: text-generation
|
|
13 |
inference: false
|
14 |
---
|
15 |
|
16 |
-
#
|
17 |
|
18 |
-
|
19 |
|
|
|
20 |
|
|
|
21 |
|
22 |
-
|
23 |
|
24 |
-
### Model Description
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
- **Model type:** [More Information Needed]
|
34 |
-
- **Language(s) (NLP):** [More Information Needed]
|
35 |
-
- **License:** [More Information Needed]
|
36 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
37 |
|
38 |
-
|
|
|
39 |
|
40 |
-
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
- **Paper [optional]:** [More Information Needed]
|
44 |
-
- **Demo [optional]:** [More Information Needed]
|
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 |
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
### Recommendations
|
75 |
-
|
76 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
77 |
-
|
78 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
79 |
-
|
80 |
-
## How to Get Started with the Model
|
81 |
-
|
82 |
-
Use the code below to get started with the model.
|
83 |
-
|
84 |
-
[More Information Needed]
|
85 |
-
|
86 |
-
## Training Details
|
87 |
-
|
88 |
-
### Training Data
|
89 |
-
|
90 |
-
<!-- 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. -->
|
91 |
-
|
92 |
-
[More Information Needed]
|
93 |
-
|
94 |
-
### Training Procedure
|
95 |
-
|
96 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
97 |
-
|
98 |
-
#### Preprocessing [optional]
|
99 |
-
|
100 |
-
[More Information Needed]
|
101 |
-
|
102 |
-
|
103 |
-
#### Training Hyperparameters
|
104 |
-
|
105 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
106 |
-
|
107 |
-
#### Speeds, Sizes, Times [optional]
|
108 |
-
|
109 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
110 |
-
|
111 |
-
[More Information Needed]
|
112 |
-
|
113 |
-
## Evaluation
|
114 |
-
|
115 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
116 |
-
|
117 |
-
### Testing Data, Factors & Metrics
|
118 |
-
|
119 |
-
#### Testing Data
|
120 |
-
|
121 |
-
<!-- This should link to a Dataset Card if possible. -->
|
122 |
-
|
123 |
-
[More Information Needed]
|
124 |
-
|
125 |
-
#### Factors
|
126 |
-
|
127 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Metrics
|
132 |
-
|
133 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
134 |
-
|
135 |
-
[More Information Needed]
|
136 |
-
|
137 |
-
### Results
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
#### Summary
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
## Model Examination [optional]
|
146 |
-
|
147 |
-
<!-- Relevant interpretability work for the model goes here -->
|
148 |
-
|
149 |
-
[More Information Needed]
|
150 |
-
|
151 |
-
## Environmental Impact
|
152 |
-
|
153 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
154 |
-
|
155 |
-
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).
|
156 |
-
|
157 |
-
- **Hardware Type:** [More Information Needed]
|
158 |
-
- **Hours used:** [More Information Needed]
|
159 |
-
- **Cloud Provider:** [More Information Needed]
|
160 |
-
- **Compute Region:** [More Information Needed]
|
161 |
-
- **Carbon Emitted:** [More Information Needed]
|
162 |
-
|
163 |
-
## Technical Specifications [optional]
|
164 |
-
|
165 |
-
### Model Architecture and Objective
|
166 |
-
|
167 |
-
[More Information Needed]
|
168 |
-
|
169 |
-
### Compute Infrastructure
|
170 |
-
|
171 |
-
[More Information Needed]
|
172 |
-
|
173 |
-
#### Hardware
|
174 |
-
|
175 |
-
[More Information Needed]
|
176 |
-
|
177 |
-
#### Software
|
178 |
-
|
179 |
-
[More Information Needed]
|
180 |
-
|
181 |
-
## Citation [optional]
|
182 |
-
|
183 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
184 |
-
|
185 |
-
**BibTeX:**
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
**APA:**
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Glossary [optional]
|
194 |
-
|
195 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
196 |
-
|
197 |
-
[More Information Needed]
|
198 |
-
|
199 |
-
## More Information [optional]
|
200 |
-
|
201 |
-
[More Information Needed]
|
202 |
-
|
203 |
-
## Model Card Authors [optional]
|
204 |
-
|
205 |
-
[More Information Needed]
|
206 |
-
|
207 |
-
## Model Card Contact
|
208 |
-
|
209 |
-
[More Information Needed]
|
210 |
|
|
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
13 |
inference: false
|
14 |
---
|
15 |
|
16 |
+
# Qwen1.5-7B-Dutch-Chat
|
17 |
|
18 |
+
## Model description
|
19 |
|
20 |
+
This DPO aligned model is the merged version of the adapter model [robinsmits/Qwen1.5-7B-Dutch-Chat-Dpo](robinsmits/Qwen1.5-7B-Dutch-Chat-Dpo).
|
21 |
|
22 |
+
DPO Finetuning was performed on the Dutch [BramVanroy/ultra_feedback_dutch_cleaned](https://huggingface.co/datasets/BramVanroy/ultra_feedback_dutch_cleaned) dataset.
|
23 |
|
24 |
+
See [Qwen/Qwen1.5-7B-Chat](https://huggingface.co/Qwen/Qwen1.5-7B-Chat) for all information about the base model.
|
25 |
|
|
|
26 |
|
27 |
+
## Model usage
|
28 |
|
29 |
+
A basic example of how to use the finetuned model.
|
30 |
|
31 |
+
```
|
32 |
+
import torch
|
33 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
device = 'cuda'
|
36 |
+
model_name = 'robinsmits/Qwen1.5-7B-Dutch-Chat'
|
37 |
|
38 |
+
model = AutoModelForCausalLM.from_pretrained(model_name,
|
39 |
+
device_map = "auto",
|
40 |
+
torch_dtype = torch.bfloat16)
|
41 |
|
42 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
|
|
43 |
|
44 |
+
messages = [{"role": "user", "content": "Hoi hoe gaat het ermee? Wat kun je me vertellen over appels?"}]
|
45 |
|
46 |
+
encoded_ids = tokenizer.apply_chat_template(messages,
|
47 |
+
add_generation_prompt = True,
|
48 |
+
return_tensors = "pt")
|
49 |
|
50 |
+
generated_ids = model.generate(input_ids = encoded_ids.to(device),
|
51 |
+
max_new_tokens = 256,
|
52 |
+
do_sample = True)
|
53 |
+
decoded = tokenizer.batch_decode(generated_ids)
|
54 |
+
print(decoded[0])
|
55 |
+
```
|
56 |
|
57 |
+
Below the chat template with the generated output.
|
58 |
|
59 |
+
```
|
60 |
+
<|im_start|>system
|
61 |
+
Je bent een behulpzame AI assistent<|im_end|>
|
62 |
+
<|im_start|>user
|
63 |
+
Hoi hoe gaat het ermee? Wat kun je me vertellen over appels?<|im_end|>
|
64 |
+
<|im_start|>assistant
|
65 |
+
Hallo! Appels zijn zo'n lekkere fruitsoort. Ze zijn zoet en knapperig, en je kunt ze koken, roosteren of zelfs in smoothies doen. Er zijn heel veel verschillende soorten appels, zoals de Fuji, Granny Smith en Gala. De appels die je meestal in de winkel koopt, komen van bomen die in het oosten van Noord-Amerika groeien.<|im_end|>
|
66 |
+
```
|
67 |
|
68 |
+
## Intended uses & limitations
|
69 |
|
70 |
+
More information needed
|
71 |
|
72 |
+
## Training and evaluation data
|
73 |
|
74 |
+
It achieves the following results on the evaluation set:
|
75 |
+
- Loss: 0.2610
|
76 |
+
- Rewards/chosen: -0.7248
|
77 |
+
- Rewards/rejected: -2.6224
|
78 |
+
- Rewards/accuracies: 0.9170
|
79 |
+
- Rewards/margins: 1.8976
|
80 |
+
- Logps/rejected: -877.8102
|
81 |
+
- Logps/chosen: -783.4282
|
82 |
+
- Logits/rejected: -0.8110
|
83 |
+
- Logits/chosen: -0.7528
|
84 |
|
85 |
+
## Training procedure
|
86 |
|
87 |
+
### Training hyperparameters
|
88 |
|
89 |
+
The following hyperparameters were used during training:
|
90 |
+
- learning_rate: 1e-05
|
91 |
+
- train_batch_size: 1
|
92 |
+
- eval_batch_size: 2
|
93 |
+
- seed: 42
|
94 |
+
- gradient_accumulation_steps: 32
|
95 |
+
- total_train_batch_size: 32
|
96 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
97 |
+
- lr_scheduler_type: cosine
|
98 |
+
- lr_scheduler_warmup_ratio: 0.05
|
99 |
+
- num_epochs: 1
|
100 |
|
101 |
+
### Training results
|
102 |
|
103 |
+
| Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|
104 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------:|:------------:|:---------------:|:-------------:|
|
105 |
+
| 0.5503 | 0.1 | 30 | 0.4684 | -0.0439 | -0.6295 | 0.8919 | 0.5856 | -837.9513 | -769.8103 | -0.9335 | -0.8894 |
|
106 |
+
| 0.4178 | 0.2 | 60 | 0.3568 | -0.3713 | -1.4769 | 0.9015 | 1.1056 | -854.9000 | -776.3594 | -0.8768 | -0.8276 |
|
107 |
+
| 0.3264 | 0.29 | 90 | 0.3143 | -0.4893 | -1.8730 | 0.9151 | 1.3837 | -862.8228 | -778.7191 | -0.8428 | -0.7929 |
|
108 |
+
| 0.2999 | 0.39 | 120 | 0.2885 | -0.6832 | -2.3118 | 0.9151 | 1.6286 | -871.5981 | -782.5971 | -0.8260 | -0.7730 |
|
109 |
+
| 0.3454 | 0.49 | 150 | 0.2749 | -0.7239 | -2.4904 | 0.9189 | 1.7664 | -875.1693 | -783.4113 | -0.8235 | -0.7678 |
|
110 |
+
| 0.3354 | 0.59 | 180 | 0.2685 | -0.6775 | -2.4859 | 0.9170 | 1.8084 | -875.0795 | -782.4824 | -0.8130 | -0.7574 |
|
111 |
+
| 0.2848 | 0.68 | 210 | 0.2652 | -0.7157 | -2.5692 | 0.9131 | 1.8535 | -876.7465 | -783.2466 | -0.8157 | -0.7586 |
|
112 |
+
| 0.3437 | 0.78 | 240 | 0.2621 | -0.7233 | -2.6091 | 0.9151 | 1.8857 | -877.5430 | -783.3994 | -0.8138 | -0.7561 |
|
113 |
+
| 0.2655 | 0.88 | 270 | 0.2611 | -0.7183 | -2.6154 | 0.9151 | 1.8971 | -877.6708 | -783.2995 | -0.8106 | -0.7524 |
|
114 |
+
| 0.3442 | 0.98 | 300 | 0.2610 | -0.7248 | -2.6224 | 0.9170 | 1.8976 | -877.8102 | -783.4282 | -0.8110 | -0.7528 |
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
### Framework versions
|
118 |
|
119 |
+
- PEFT 0.9.0
|
120 |
+
- Transformers 4.38.2
|
121 |
+
- Pytorch 2.2.1+cu121
|
122 |
+
- Datasets 2.17.1
|
123 |
+
- Tokenizers 0.15.2
|