Skywork-13B-Math: Skywork-13B-Math model has undergone specialized training to enhance its mathematical abilities. In the 13B-scale model, the Skywork-13B-Math model ranked first in the GSM8K evaluation, and it also performed exceptionally well on the MATH dataset and CMATH, placing it among the top-level 13B models.
Skywork-13B-Math has further enhanced mathematical capabilities compared to the Base model. We conducted evaluations on mainstream mathematical related benchmarks, GSM8K, MATH, and CMATH. The results show that in the 13B scale model, our model ranked 1st in the GSM8K and CMATH benchmarks, and is also at the forefront in the MATH benchmark.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
34tokenizer_path =""5checkpoint_path =""67tokenizer = AutoTokenizer.from_pretrained(8 tokenizer_path, use_fast=False, trust_remote_code=True, padding_side='left')910model = AutoModelForCausalLM.from_pretrained(11 checkpoint_path, device_map="auto", trust_remote_code=True).eval()12tokenizer.add_tokens(["[USER]","[BOT]","[SEP]"])1314defspecial_encode(input, tokenizer):15 raw_str ="[USER]%s[SEP][BOT]"%input.strip().replace("\r","")16 eos_id = tokenizer.eos_token_id
17 bos_id = tokenizer.bos_token_id
18 sep_id = tokenizer.encode("[SEP]")[-1]19 res_id =[eos_id, bos_id]20 arr = raw_str.split("[SEP]")21for elem_idx inrange(len(arr)):22 elem = arr[elem_idx]23 elem_id = tokenizer.encode(elem)[1:]24 res_id += elem_id
25if elem_idx <len(arr)-1:26 res_id.append(sep_id)2728return res_id
2930defextract_res(response):31if"[BOT]"in response:32 response = response.split("[BOT]")[1]33if"<s>"in response:34 response = response.split("<s>")[-1]35if"</s>"in response:36 response = response.split("</s>")[0]37if"[SEP]"in response:38 response = response.split("[SEP]")[0]39return response
4041if __name__ =='__main__':42 text="Janet’s ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?"43 text_token_ids = torch.tensor(special_encode(44 text, tokenizer)).to(model.device).reshape(1,-1)45 response = model.generate(text_token_ids, do_sample=False, max_length=512)46 response_text = tokenizer.decode(response.cpu()[0], skip_special_tokens=True)47 response_text = extract_res(response_text)48print(response_text)49"""Skywork-13B-Math Response:
50 First, we need to find out how many eggs Janet has left after eating for breakfast and baking for her friends. \n\nShe has 16 eggs per day, eats 3 for breakfast and uses 4 for baking. So, 16 - 3 - 4 = 9 eggs are left for selling at the farmers' market.\n\nSince she sells each egg for $2, she makes 9 * 2 = $<<9*2=18>>18 every day at the farmers' market.\n\nSo, the answer is $18.
51 """
We hereby declare that the Skywork model should not be used for any activities that pose a threat to national or societal security or engage in unlawful actions. Additionally, we request users not to deploy the Skywork model for internet services without appropriate security reviews and records. We hope that all users will adhere to this principle to ensure that technological advancements occur in a regulated and lawful environment.
We have done our utmost to ensure the compliance of the data used during the model's training process. However, despite our extensive efforts, due to the complexity of the model and data, there may still be unpredictable risks and issues. Therefore, if any problems arise as a result of using the Skywork open-source model, including but not limited to data security issues, public opinion risks, or any risks and problems arising from the model being misled, abused, disseminated, or improperly utilized, we will not assume any responsibility.
The community usage of Skywork model requires Skywork Community License. The Skywork model supports commercial use. If you plan to use the Skywork model or its derivatives for commercial purposes, you must abide by terms and conditions within Skywork Community License.
引用和联系我们(Contact Us and Citation)
如果您觉得我们的工作对您有帮助,欢迎引用我们的论文~
If you find our work helpful, please feel free to cite our paper~
@misc{wei2023skywork,
title={Skywork: A More Open Bilingual Foundation Model},
author={Tianwen Wei and Liang Zhao and Lichang Zhang and Bo Zhu and Lijie Wang and Haihua Yang and Biye Li and Cheng Cheng and Weiwei Lü and Rui Hu and Chenxia Li and Liu Yang and Xilin Luo and Xuejie Wu and Lunan Liu and Wenjun Cheng and Peng Cheng and Jianhao Zhang and Xiaoyu Zhang and Lei Lin and Xiaokun Wang and Yutuan Ma and Chuanhai Dong and Yanqi Sun and Yifu Chen and Yongyi Peng and Xiaojuan Liang and Shuicheng Yan and Han Fang and Yahui Zhou},
year={2023},
eprint={2310.19341},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@article{Skywork_Multi-Modal_Group_Empirical_Study_Towards_2023,
author = {Skywork Multi-Modal Group},
month = sep,
title = {{Empirical Study Towards Building An Effective Multi-Modal Large Language Model}},
year = {2023}
}