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.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer_path = ""
checkpoint_path = ""
tokenizer = AutoTokenizer.from_pretrained(
tokenizer_path, use_fast=False, trust_remote_code=True, padding_side='left')
model = AutoModelForCausalLM.from_pretrained(
checkpoint_path, device_map="auto", trust_remote_code=True).eval()
tokenizer.add_tokens(["[USER]", "[BOT]", "[SEP]"])
defspecial_encode(input, tokenizer):
raw_str = "[USER]%s[SEP][BOT]" % input.strip().replace("\r", "")
eos_id = tokenizer.eos_token_id
bos_id = tokenizer.bos_token_id
sep_id = tokenizer.encode("[SEP]")[-1]
res_id = [eos_id, bos_id]
arr = raw_str.split("[SEP]")
for elem_idx inrange(len(arr)):
elem = arr[elem_idx]
elem_id = tokenizer.encode(elem)[1:]
res_id += elem_id
if elem_idx < len(arr) - 1:
res_id.append(sep_id)
return res_id
defextract_res(response):
if"[BOT]"in response:
response = response.split("[BOT]")[1]
if"<s>"in response:
response = response.split("<s>")[-1]
if"</s>"in response:
response = response.split("</s>")[0]
if"[SEP]"in response:
response = response.split("[SEP]")[0]
return response
if __name__ == '__main__':
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?"
text_token_ids = torch.tensor(special_encode(
text, tokenizer)).to(model.device).reshape(1, -1)
response = model.generate(text_token_ids, do_sample=False, max_length=512)
response_text = tokenizer.decode(response.cpu()[0], skip_special_tokens=True)
response_text = extract_res(response_text)
print(response_text)
"""Skywork-13B-Math Response: 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. """
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}
}
Runs of Skywork Skywork-13B-Math-8bits on huggingface.co
22
Total runs
0
24-hour runs
2
3-day runs
2
7-day runs
4
30-day runs
More Information About Skywork-13B-Math-8bits huggingface.co Model
Skywork-13B-Math-8bits huggingface.co is an AI model on huggingface.co that provides Skywork-13B-Math-8bits's model effect (), which can be used instantly with this Skywork Skywork-13B-Math-8bits model. huggingface.co supports a free trial of the Skywork-13B-Math-8bits model, and also provides paid use of the Skywork-13B-Math-8bits. Support call Skywork-13B-Math-8bits model through api, including Node.js, Python, http.
Skywork-13B-Math-8bits huggingface.co is an online trial and call api platform, which integrates Skywork-13B-Math-8bits's modeling effects, including api services, and provides a free online trial of Skywork-13B-Math-8bits, you can try Skywork-13B-Math-8bits online for free by clicking the link below.
Skywork Skywork-13B-Math-8bits online free url in huggingface.co:
Skywork-13B-Math-8bits is an open source model from GitHub that offers a free installation service, and any user can find Skywork-13B-Math-8bits on GitHub to install. At the same time, huggingface.co provides the effect of Skywork-13B-Math-8bits install, users can directly use Skywork-13B-Math-8bits installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Skywork-13B-Math-8bits install url in huggingface.co: