Downloads · 30 days
9
2% of all-time downloads
robinsmits/Qwen1.5-7B-Dutch-Chat-Sft
Qwen1.5-7B-Dutch-Chat-Sft is a text generation model from robinsmits. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-4.0.
This finetuned model is an adapter model based on Qwen/Qwen1.5-7B-Chat.
Downloads · 30 days
9
2% of all-time downloads
All-time downloads
463
Public
Repo size
6.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors640 MB · 98%
From the Hugging Face model README
This finetuned model is an adapter model based on Qwen/Qwen1.5-7B-Chat.
Finetuning was performed on the Dutch BramVanroy/ultrachat_200k_dutch dataset.
A basic example of how to use the finetuned model.
import torch
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
device = 'cuda'
model_name = 'robinsmits/Qwen1.5-7B-Dutch-Chat-Sft'
model = AutoPeftModelForCausalLM.from_pretrained(model_name,
device_map = "auto",
load_in_4bit = True,
torch_dtype = torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(model_name)
messages = [{"role": "user", "content": "Hoi hoe gaat het ermee? Wat kun je me vertellen over appels?"}]
encoded_ids = tokenizer.apply_chat_template(messages,
add_generation_prompt = True,
return_tensors = "pt")
generated_ids = model.generate(input_ids = encoded_ids.to(device),
max_new_tokens = 256,
do_sample = True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
Below the chat template with the generated output.
<|im_start|>system
Je bent een behulpzame AI assistent<|im_end|>
<|im_start|>user
Hoi hoe gaat het ermee? Wat kun je me vertellen over appels?<|im_end|>
<|im_start|>assistant
Hallo! Appels zijn fruit dat heel populair is. Ze zijn lekker en er zijn veel verschillende soorten, zoals rode, witte en bruine appels. Je kunt ze eten met wat kaas of op een salade voor een fris gerecht. Het is ook goed voor je gezondheid omdat ze rijk zijn aan vitamine C en vezels.<|im_end|>
As with all LLM's this model can also experience bias and hallucinations. Regardless of how you use this model always perform the necessary testing and validation.
The used dataset does not allow commercial usage.
The training notebook is available at the following link: Qwen1_5_7B_Dutch_Chat_SFT
Training was performed with Google Colab PRO on a A100 - 40GB.
As the amount of data was more than would fit within the maximum 24 hour session that Google Colab PRO allows I split the dataset in 2 equal parts. Training for each part lasted around 14 hours. In the second part I enabled 'resume_from_checkpoint' to continue the training.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.4493 | 0.2 | 146 | 1.4083 |
| 1.3638 | 0.4 | 292 | 1.3213 |
| 1.3146 | 0.6 | 438 | 1.2731 |
| 1.2756 | 0.8 | 584 | 1.2400 |
| 1.2533 | 1.0 | 730 | 1.2165 |
| 1.2388 | 1.19 | 876 | 1.1998 |
| 1.2246 | 1.39 | 1022 | 1.1882 |
| 1.211 | 1.59 | 1168 | 1.1802 |
| 1.204 | 1.79 | 1314 | 1.1763 |
| 1.2041 | 1.99 | 1460 | 1.1756 |
Thanks to the creators of Qwen1.5 for there great work!
@article{qwen,
title={Qwen Technical Report},
author={Jinze Bai and Shuai Bai and Yunfei Chu and Zeyu Cui and Kai Dang and Xiaodong Deng and Yang Fan and Wenbin Ge and Yu Han and Fei Huang and Binyuan Hui and Luo Ji and Mei Li and Junyang Lin and Runji Lin and Dayiheng Liu and Gao Liu and Chengqiang Lu and Keming Lu and Jianxin Ma and Rui Men and Xingzhang Ren and Xuancheng Ren and Chuanqi Tan and Sinan Tan and Jianhong Tu and Peng Wang and Shijie Wang and Wei Wang and Shengguang Wu and Benfeng Xu and Jin Xu and An Yang and Hao Yang and Jian Yang and Shusheng Yang and Yang Yao and Bowen Yu and Hongyi Yuan and Zheng Yuan and Jianwei Zhang and Xingxuan Zhang and Yichang Zhang and Zhenru Zhang and Chang Zhou and Jingren Zhou and Xiaohuan Zhou and Tianhang Zhu},
journal={arXiv preprint arXiv:2309.16609},
year={2023}
}