Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,107 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
license: mit
|
| 5 |
+
base_model:
|
| 6 |
+
- ByteDance-Seed/Seed-Coder-8B-Base-bf16
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Seed-Coder-8B-Reasoning-bf16
|
| 10 |
+
|
| 11 |
+
<div align="left" style="line-height: 1;">
|
| 12 |
+
<a href="https://bytedance-seed-coder.github.io/" target="_blank" style="margin: 2px;">
|
| 13 |
+
<img alt="Homepage" src="https://img.shields.io/badge/Seed--Coder-Homepage-a468fe?color=a468fe&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 14 |
+
</a>
|
| 15 |
+
|
| 16 |
+
<a href="https://github.com/ByteDance-Seed/Seed-Coder/blob/master/Seed-Coder.pdf" target="_blank" style="margin: 2px;">
|
| 17 |
+
<img alt="Technical Report" src="https://img.shields.io/badge/(upcoming)-Technical%20Report-brightgreen?logo=arxiv&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 18 |
+
</a>
|
| 19 |
+
|
| 20 |
+
<a href="https://huggingface.co/ByteDance-Seed" target="_blank" style="margin: 2px;">
|
| 21 |
+
<img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-ByteDance%20Seed-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 22 |
+
</a>
|
| 23 |
+
|
| 24 |
+
<a href="https://github.com/ByteDance-Seed/Seed-Coder/blob/master/LICENSE" style="margin: 2px;">
|
| 25 |
+
<img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?color=f5de53&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
|
| 26 |
+
</a>
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## Introduction
|
| 31 |
+
We are thrilled to introduce Seed-Coder, a powerful, transparent, and parameter-efficient family of open-source code models at the 8B scale, featuring base, instruct, and reasoning variants. Seed-Coder contributes to promote the evolution of open code models through the following highlights.
|
| 32 |
+
|
| 33 |
+
- **Model-centric:** Seed-Coder predominantly leverages LLMs instead of hand-crafted rules for code data filtering, minimizing manual effort in pretraining data construction.
|
| 34 |
+
- **Transparent:** We openly share detailed insights into our model-centric data pipeline, including methods for curating GitHub data, commits data, and code-related web data.
|
| 35 |
+
- **Powerful:** Seed-Coder achieves state-of-the-art performance among open-source models of comparable size across a diverse range of coding tasks.
|
| 36 |
+
|
| 37 |
+
<p align="center">
|
| 38 |
+
<img width="100%" src="imgs/seed-coder_intro_performance.jpg">
|
| 39 |
+
</p>
|
| 40 |
+
|
| 41 |
+
This is the **bf16 version** of the Seed-Coder-8B-Reasoning model, which has the following features:
|
| 42 |
+
- Type: Causal language models
|
| 43 |
+
- Training Stage: Pretraining & Post-training
|
| 44 |
+
- Data Source: Public datasets
|
| 45 |
+
- Context Length: 65,536
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
## Model Downloads
|
| 49 |
+
| Model Name | Length | Download | Notes |
|
| 50 |
+
|---------------------------------------------------------|-----------|------------------------------------|-----------------------|
|
| 51 |
+
| Seed-Coder-8B-Base | 32K | 🤗 [Model](https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Base) | Pretrained on our model-centric code data. |
|
| 52 |
+
| Seed-Coder-8B-Instruct | 32K | 🤗 [Model](https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Instruct) | Instruction-tuned for alignment with user intent. |
|
| 53 |
+
| Seed-Coder-8B-Reasoning | 32K | 🤗 [Model](https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Reasoning) | RL trained to boost reasoning capabilities. |
|
| 54 |
+
| 👉 **Seed-Coder-8B-Reasoning** (bf16) | 32K | 🤗 [Model](https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16) | RL trained to boost reasoning capabilities. This is the **bf16 version**. |
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
## Requirements
|
| 59 |
+
You will need to install the latest versions of `transformers` and `accelerate`:
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
pip install -U transformers accelerate
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Quickstart
|
| 66 |
+
|
| 67 |
+
Here is a simple example demonstrating how to load the model and perform code generation using the Hugging Face `pipeline` API:
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 71 |
+
import torch
|
| 72 |
+
|
| 73 |
+
model_id = "ByteDance-Seed/Seed-Coder-8B-Reasoning"
|
| 74 |
+
|
| 75 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 76 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
|
| 77 |
+
|
| 78 |
+
messages = [
|
| 79 |
+
{"role": "user", "content": "Write a quick sort algorithm."},
|
| 80 |
+
]
|
| 81 |
+
|
| 82 |
+
input_ids = tokenizer.apply_chat_template(
|
| 83 |
+
messages,
|
| 84 |
+
tokenize=True,
|
| 85 |
+
return_tensors="pt",
|
| 86 |
+
add_generation_prompt=True,
|
| 87 |
+
).to(model.device)
|
| 88 |
+
|
| 89 |
+
outputs = model.generate(input_ids, max_new_tokens=16384)
|
| 90 |
+
response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
|
| 91 |
+
print(response)
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## Evaluation
|
| 95 |
+
Seed-Coder-8B-Reasoning strikes impressive performance on competitive programming, demonstrating that smaller LLMs can also be competent on complex reasoning tasks. Our model surpasses QwQ-32B and DeepSeek-R1 on IOI'2024, and achieves an ELO rating comparable to o1-mini on Codeforces contests.
|
| 96 |
+
|
| 97 |
+
<div style="display: flex; justify-content: center;">
|
| 98 |
+
<img src="imgs/reasoning-ioi.jpg" width="61%" />
|
| 99 |
+
<img src="imgs/reasoning-codeforces.jpg" width="39%" />
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
For detailed benchmark performance, please refer to our [📑 Technical Report](https://github.com/ByteDance-Seed/Seed-Coder/blob/master/Seed-Coder.pdf).
|
| 104 |
+
|
| 105 |
+
## License
|
| 106 |
+
|
| 107 |
+
This project is licensed under the MIT License. See the [LICENSE file](https://github.com/ByteDance-Seed/Seed-Coder/blob/master/LICENSE) for details.
|