🏠 Home Page | 🤗 Model | 📊 Dataset | 📄Paper | 🚀Demo
OpenCoder is an open and reproducible code LLM family which includes 1.5B and 8B base and chat models, supporting both English and Chinese languages. Starting from scratch, OpenCoder is pretrained on 2.5 trillion tokens composed of 90% raw code and 10% code-related web data, and supervised finetuned on over 4.5M high-quality SFT examples, finally reaching the performance of top-tier code LLMs. We provide not only model weights and inference code, but also the reproducible training data, the complete data processing pipeline, rigorous experimental ablation results, and detailed training protocols. Empowering researchers to build and innovate, OpenCoder is your open foundation for advancing code AI.
| Model | Sequence Length | Download |
|---|---|---|
| OpenCoder-1.5B-Base | 4K | 🤗 HuggingFace |
| OpenCoder-8B-Base | 8K | 🤗 HuggingFace |
| OpenCoder-1.5B-Instruct | 4K | 🤗 HuggingFace |
| OpenCoder-8B-Instruct | 8K | 🤗 HuggingFace |
| Dataset | Size | Download |
|---|---|---|
| fineweb-code-corpus | 148 GB | 🤗 HuggingFace |
| fineweb-math-corpus | 10 GB | 🤗 HuggingFace |
| Dataset | Num | Download |
|---|---|---|
| opencoder-sft-stage1 | 4.21 M | 🤗 HuggingFace |
| opencoder-sft-stage2 | 375 K | 🤗 HuggingFace |
This is not the end; we are organizing the remaining data and uploading it progressively.
Note: For the detailed evaluation results, please refer to our paper.
| model | OpenCoder-1.5B-Instruct | OpenCoder-8B-Instruct |
|---|---|---|
| HumanEval(+) | 72.5 (67.7) | 83.5 (78.7) |
| MBPP(+) | 72.7 (61.9) | 79.1 (69.0) |
| BigCodeBench | 33.3 | 40.3 |
| BigCodeBench-Hard | 11.5 | 16.9 |
| LiveCodeBench | 12.8 | 23.2 |
| MultiPL-E (AVG) | 57.5 | 71.0 |
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "infly/OpenCoder-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
messages=[
{ 'role': 'user', 'content': "write a quick sort algorithm in python."}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False)
result = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
print(result)
OpenCoder series (including Base and Chat) support commercial applications under a permissive License.
@inproceedings{Huang2024OpenCoderTO,
title={OpenCoder: The Open Cookbook for Top-Tier Code Large Language Models},
author={Siming Huang and Tianhao Cheng and Jason Klein Liu and Jiaran Hao and Liuyihan Song and Yang Xu and J. Yang and J. H. Liu and Chenchen Zhang and Linzheng Chai and Ruifeng Yuan and Zhaoxiang Zhang and Jie Fu and Qian Liu and Ge Zhang and Zili Wang and Yuan Qi and Yinghui Xu and Wei Chu},
year={2024},
url={https://arxiv.org/pdf/2411.04905}
}
9 commits
4 commits
🏠 Home Page | 🤗 Model | 📊 Dataset | 📄Paper | 🚀Demo
OpenCoder is an open and reproducible code LLM family which includes 1.5B and 8B base and chat models, supporting both English and Chinese languages. Starting from scratch, OpenCoder is pretrained on 2.5 trillion tokens composed of 90% raw code and 10% code-related web data, and supervised finetuned on over 4.5M high-quality SFT examples, finally reaching the performance of top-tier code LLMs. We provide not only model weights and inference code, but also the reproducible training data, the complete data processing pipeline, rigorous experimental ablation results, and detailed training protocols. Empowering researchers to build and innovate, OpenCoder is your open foundation for advancing code AI.
| Model | Sequence Length | Download |
|---|---|---|
| OpenCoder-1.5B-Base | 4K | 🤗 HuggingFace |
| OpenCoder-8B-Base | 8K | 🤗 HuggingFace |
| OpenCoder-1.5B-Instruct | 4K | 🤗 HuggingFace |
| OpenCoder-8B-Instruct | 8K | 🤗 HuggingFace |
| Dataset | Size | Download |
|---|---|---|
| fineweb-code-corpus | 148 GB | 🤗 HuggingFace |
| fineweb-math-corpus | 10 GB | 🤗 HuggingFace |
| Dataset | Num | Download |
|---|---|---|
| opencoder-sft-stage1 | 4.21 M | 🤗 HuggingFace |
| opencoder-sft-stage2 | 375 K | 🤗 HuggingFace |
This is not the end; we are organizing the remaining data and uploading it progressively.
Note: For the detailed evaluation results, please refer to our paper.
| model | OpenCoder-1.5B-Instruct | OpenCoder-8B-Instruct |
|---|---|---|
| HumanEval(+) | 72.5 (67.7) | 83.5 (78.7) |
| MBPP(+) | 72.7 (61.9) | 79.1 (69.0) |
| BigCodeBench | 33.3 | 40.3 |
| BigCodeBench-Hard | 11.5 | 16.9 |
| LiveCodeBench | 12.8 | 23.2 |
| MultiPL-E (AVG) | 57.5 | 71.0 |
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "infly/OpenCoder-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
messages=[
{ 'role': 'user', 'content': "write a quick sort algorithm in python."}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False)
result = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
print(result)
OpenCoder series (including Base and Chat) support commercial applications under a permissive License.
@inproceedings{Huang2024OpenCoderTO,
title={OpenCoder: The Open Cookbook for Top-Tier Code Large Language Models},
author={Siming Huang and Tianhao Cheng and Jason Klein Liu and Jiaran Hao and Liuyihan Song and Yang Xu and J. Yang and J. H. Liu and Chenchen Zhang and Linzheng Chai and Ruifeng Yuan and Zhaoxiang Zhang and Jie Fu and Qian Liu and Ge Zhang and Zili Wang and Yuan Qi and Yinghui Xu and Wei Chu},
year={2024},
url={https://arxiv.org/pdf/2411.04905}
}
9 commits
4 commits