Ziya-Coding-15B-v1 is a pre-training model with 15.5 billion parameters based on StarCoderBase. It can complete a series of code-related tasks such as generating and modifying code, code interpretation, code continuation, NL2SQL, etc., according to instructions. Currently, Ziya-Writing-LLaMa-13B-v1 has completed the large-scale pre-training (PT), and supervised fine-tuning (SFT) training process.
Due to the fact that the training data for StarCoderBase is primarily code data, its language comprehension and command compliance capabilities are relatively weak, especially in scenarios where Chinese is used to generate code. To leverage its excellent code generation capabilities and enhance the model's Chinese language understanding capabilities, we have carefully selected high-quality corpus of 100B tokens from our self-built pre-training corpus, which includes Chinese, English, and code, for further pre-training.
During the incremental training process, we used 144 A100s with 40GB each for 10 days of training, with a batch size of 2.6M. We utilized technologies such as FlashAttention and Multi-Query Attention to accelerate model training and reduce GPU memory usage, achieving a throughput of 139.8 TFLOPS.
We have collected and organized a large amount of code task datasets, and conducted strict cleaning based on rules and compilation feedback, constructing high-quality code instruction data. The data includes a rich variety of tasks such as competition questions, code translation, SQL, code interpretation, code generation, code knowledge Q&A, etc., ensuring the diversity of instructions.
At the same time, we have generated more high-quality general instruction data using the self-instruct and evol-instruct methods.
We conducted fine-tuning in three stages. In the first stage, we used 450,000 pieces of general Chinese data (sampled from our self-built instruction dataset) to train the model to align with human intentions. In the second stage of supervised training, we used Chinese and English code instruction data to stimulate the model's coding capabilities. In the third stage, we used compilation feedback to construct strictly high-quality code generation data, further improving the accuracy of generation.
In the fine-tuning dataset, we excluded the evaluation task dataset to avoid data leakage. The pass@1 metric for HumanEval is based on the results of greedy generation, while pass@10 and pass@100 are based on the results generated with a temperature parameter of 0.9.
使用 Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
device = torch.device("cuda")
prompt = "写一段快速排序"
model = AutoModelForCausalLM.from_pretrained("IDEA-CCNL/Ziya-Coding-15B-v1", torch_dtype=torch.float16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("IDEA-CCNL/Ziya-Coding-15B-v1", use_fast=False)
pre_prompt = "The following is a conversation between a human and an artificial intelligence assistant developed by IDEA."
input = pre_prompt + "<|Human|>:" + prompt + "<|Bot|>:"
input_ids = tokenizer(input, return_tensors="pt").input_ids.to(device)
generate_ids = model.generate(
input_ids,
max_new_tokens=512,
do_sample = True,
top_p = 0.85,
temperature = 1.0,
repetition_penalty=1.,
eos_token_id=tokenizer.encode("<|end|>"),
)
output = tokenizer.batch_decode(generate_ids)[0]
print(output)
If you are using the resource for your work, please cite the our
paper
:
@article{fengshenbang,
author = {Jiaxing Zhang and Ruyi Gan and Junjie Wang and Yuxiang Zhang and Lin Zhang and Ping Yang and Xinyu Gao and Ziwei Wu and Xiaoqun Dong and Junqing He and Jianheng Zhuo and Qi Yang and Yongfeng Huang and Xiayu Li and Yanghan Wu and Junyu Lu and Xinyu Zhu and Weifeng Chen and Ting Han and Kunhao Pan and Rui Wang and Hao Wang and Xiaojun Wu and Zhongshen Zeng and Chongpei Chen},
title = {Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence},
journal = {CoRR},
volume = {abs/2209.02970},
year = {2022}
}
Ziya-Coding-15B-v1 huggingface.co is an AI model on huggingface.co that provides Ziya-Coding-15B-v1's model effect (), which can be used instantly with this IDEA-CCNL Ziya-Coding-15B-v1 model. huggingface.co supports a free trial of the Ziya-Coding-15B-v1 model, and also provides paid use of the Ziya-Coding-15B-v1. Support call Ziya-Coding-15B-v1 model through api, including Node.js, Python, http.
Ziya-Coding-15B-v1 huggingface.co is an online trial and call api platform, which integrates Ziya-Coding-15B-v1's modeling effects, including api services, and provides a free online trial of Ziya-Coding-15B-v1, you can try Ziya-Coding-15B-v1 online for free by clicking the link below.
IDEA-CCNL Ziya-Coding-15B-v1 online free url in huggingface.co:
Ziya-Coding-15B-v1 is an open source model from GitHub that offers a free installation service, and any user can find Ziya-Coding-15B-v1 on GitHub to install. At the same time, huggingface.co provides the effect of Ziya-Coding-15B-v1 install, users can directly use Ziya-Coding-15B-v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.