|
--- |
|
license: bigcode-openrail-m |
|
--- |
|
|
|
# **Opencsg-starcoder-v0.1** [[中文]](#chinese) [[English]](#english) |
|
|
|
<a id="english"></a> |
|
|
|
<p align="center"> |
|
<img width="300px" alt="OpenCSG" src="https://cdn-uploads.huggingface.co/production/uploads/64c71b27d43e4dee51a8b31a/GwYXPKuEoGCGcMICeW-sb.jpeg"> |
|
</p> |
|
|
|
<p align="center"><a href="https://portal.opencsg.com/models">[OpenCSG Community]</a> <a href="https://github.com/opencsgs">[github]</a> <a href="https://cdn-uploads.huggingface.co/production/uploads/64c71b27d43e4dee51a8b31a/HU6vz21qKTEmUBCWqCFh9.jpeg">[wechat]</a> <a href="https://twitter.com/OpenCsg">[Twitter]</a> </p> |
|
|
|
|
|
</div> |
|
OpenCSG stands for Converged resources, Software refined, and Generative LM. The 'C' represents Converged resources, indicating the integration and full utilization of hybrid resources. The 'S' stands for Software refined, signifying software that is refined by large models. The 'G' represents Generative LM, which denotes widespread, inclusive, and democratized generative large models. |
|
|
|
The vision of OpenCSG is to empower every industry, every company, and every individual to own their models. We adhere to the principles of openness and open source, making the large model software stack of OpenCSG available to the community. We welcome everyone to use, feedback, and collaborative contribute. |
|
|
|
|
|
|
|
## Model Description |
|
|
|
The [StarCoder](https://huggingface.co/bigcode/starcoder) models are 15.5B parameter models trained on 80+ programming languages from [The Stack (v1.2)](https://huggingface.co/datasets/bigcode/the-stack), with opt-out requests excluded. |
|
Based on StarCoder, opencsg-starcoder-v0.1 was fintuned by OpenCSG LLM Research Team througth full-paramters fine-tuning method. |
|
<br> |
|
|
|
|
|
## Model Eval |
|
|
|
HumanEval is the commonest code generation benchmark to evaluate the performance of models, especially on the the compeltion of code exercise cases. |
|
Somehow, model evaluation is a kind of metaphysics. Different models are sensitive to different decoding methods, paramters and instructions. |
|
It is impratical for us to manually set specific configuration for each fine-tuned model, because a real LLM should master the universal capability despite the parameters manipulated by users. |
|
|
|
Thus, OpenCSG strained our brains to provide a relatively fair method to compare the fine-tuned models on HumanEval benchmark. |
|
To simplify the comparision, we chosed the Pass@1 metric on python language, but our finetuning dataset includes samples in multi language. |
|
|
|
**For fair, we evaluated the fine-tuned and origin starcoder models only with the original cases' prompts, not including any other instruction else.** |
|
|
|
**Otherwise, we use greedy decoding method for each model during the evaluation.** |
|
|
|
| Model | HumanEval python pass@1 | |
|
| --- |----------------------------------------------------------------------------- | |
|
| starcoder | 35.98%| |
|
| opencsg-starcoder-v0.1| **39.02%** | |
|
|
|
**TODO** |
|
- we will provide much more benchmark scores on fine-tuned models in future. |
|
- we will provide different practical problems to evaluate the performance of fine-tuned models in the field of software engineering. |
|
|
|
|
|
|
|
# Model Usage |
|
|
|
|
|
```python |
|
from transformers import AutoTokenizer |
|
import transformers |
|
import torch |
|
|
|
model = "opencsg/opencsg-starcoder-v0.1" |
|
|
|
tokenizer = AutoTokenizer.from_pretrained(model, trust_remote_code=True) |
|
pipeline = transformers.pipeline( |
|
"text-generation", |
|
model=model, |
|
torch_dtype=torch.float16, |
|
device_map="auto", |
|
) |
|
input_text = """def quick_sort(arr): |
|
if len(arr) <= 1: |
|
return arr |
|
pivot = arr[0] |
|
left = [] |
|
right = [] |
|
<FILL_ME> |
|
if arr[i] < pivot: |
|
left.append(arr[i]) |
|
else: |
|
right.append(arr[i]) |
|
return quick_sort(left) + [pivot] + quick_sort(right) |
|
""" |
|
sequences = pipeline( |
|
input_text, |
|
do_sample=False, |
|
top_k=10, |
|
temperature=0.1, |
|
top_p=0.95, |
|
num_return_sequences=1, |
|
eos_token_id=tokenizer1.eos_token_id, |
|
max_length=256, |
|
) |
|
for seq in sequences: |
|
print(seq['generated_text'][len(input_text):]) |
|
``` |
|
# Training |
|
|
|
## Hardware |
|
|
|
- **GPUs:** 8 Tesla A800 |
|
- **Training time:** 7 hours |
|
|
|
## Software |
|
|
|
- **Orchestration:** [Deepspeed](https://github.com/OpenCSGs) |
|
- **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch) |
|
- **BP16 if applicable:** [apex](https://github.com/NVIDIA/apex) |
|
|