初始化项目,由ModelHub XC社区提供模型
Model: bigcode/starcoderbase-1b Source: Original Platform
This commit is contained in:
51
.gitattributes
vendored
Normal file
51
.gitattributes
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
||||
*.tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
*.db* filter=lfs diff=lfs merge=lfs -text
|
||||
*.ark* filter=lfs diff=lfs merge=lfs -text
|
||||
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
|
||||
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
|
||||
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.gguf* filter=lfs diff=lfs merge=lfs -text
|
||||
*.ggml filter=lfs diff=lfs merge=lfs -text
|
||||
*.llamafile* filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
||||
230
README.md
Normal file
230
README.md
Normal file
@@ -0,0 +1,230 @@
|
||||
---
|
||||
pipeline_tag: text-generation
|
||||
inference: true
|
||||
widget:
|
||||
- text: 'def print_hello_world():'
|
||||
example_title: Hello world
|
||||
group: Python
|
||||
license: bigcode-openrail-m
|
||||
datasets:
|
||||
- bigcode/the-stack-dedup
|
||||
metrics:
|
||||
- code_eval
|
||||
library_name: transformers
|
||||
tags:
|
||||
- code
|
||||
model-index:
|
||||
- name: StarCoderBase-1B
|
||||
results:
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: openai_humaneval
|
||||
name: HumanEval
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 15.17
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (C++)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 11.68
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (Java)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 14.2
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (JavaScript)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 13.38
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (PHP)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 9.94
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (Lua)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 12.52
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (Rust)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 10.24
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (Swift)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 3.92
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (Julia)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 11.31
|
||||
verified: false
|
||||
- task:
|
||||
type: text-generation
|
||||
dataset:
|
||||
type: nuprl/MultiPL-E
|
||||
name: MultiPL-HumanEval (R)
|
||||
metrics:
|
||||
- name: pass@1
|
||||
type: pass@1
|
||||
value: 5.37
|
||||
verified: false
|
||||
extra_gated_prompt: >-
|
||||
## Model License Agreement
|
||||
|
||||
Please read the BigCode [OpenRAIL-M
|
||||
license](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement)
|
||||
agreement before accepting it.
|
||||
|
||||
extra_gated_fields:
|
||||
I accept the above license agreement, and will use the Model complying with the set of use restrictions and sharing requirements: checkbox
|
||||
duplicated_from: bigcode-data/starcoderbase-1b
|
||||
---
|
||||
|
||||
|
||||
# StarCoderBase-1B
|
||||
|
||||
1B version of [StarCoderBase](https://huggingface.co/bigcode/starcoderbase).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Model Summary](##model-summary)
|
||||
2. [Use](##use)
|
||||
3. [Limitations](##limitations)
|
||||
4. [Training](##training)
|
||||
5. [License](##license)
|
||||
6. [Citation](##citation)
|
||||
|
||||
## Model Summary
|
||||
|
||||
StarCoderBase-1B is a 1B parameter model trained on 80+ programming languages from [The Stack (v1.2)](https://huggingface.co/datasets/bigcode/the-stack), with opt-out requests excluded. The model uses [Multi Query Attention](https://arxiv.org/abs/1911.02150), [a context window of 8192 tokens](https://arxiv.org/abs/2205.14135), and was trained using the [Fill-in-the-Middle objective](https://arxiv.org/abs/2207.14255) on 1 trillion tokens.
|
||||
|
||||
- **Repository:** [bigcode/Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
|
||||
- **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
|
||||
- **Paper:** [💫StarCoder: May the source be with you!](https://arxiv.org/abs/2305.06161)
|
||||
- **Point of Contact:** [contact@bigcode-project.org](mailto:contact@bigcode-project.org)
|
||||
- **Languages:** 80+ Programming languages
|
||||
|
||||
|
||||
## Use
|
||||
|
||||
### Intended use
|
||||
|
||||
The model was trained on GitHub code. As such it is _not_ an instruction model and commands like "Write a function that computes the square root." do not work well. However, by using the [Tech Assistant prompt](https://huggingface.co/datasets/bigcode/ta-prompt) you can turn it into a capable technical assistant.
|
||||
|
||||
**Feel free to share your generations in the Community tab!**
|
||||
|
||||
### Generation
|
||||
```python
|
||||
# pip install -q transformers
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
checkpoint = "bigcode/starcoderbase-1b"
|
||||
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
||||
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
||||
|
||||
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
|
||||
outputs = model.generate(inputs)
|
||||
print(tokenizer.decode(outputs[0]))
|
||||
```
|
||||
|
||||
### Fill-in-the-middle
|
||||
Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
|
||||
|
||||
```python
|
||||
input_text = "<fim_prefix>def print_hello_world():\n <fim_suffix>\n print('Hello world!')<fim_middle>"
|
||||
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
||||
outputs = model.generate(inputs)
|
||||
print(tokenizer.decode(outputs[0]))
|
||||
```
|
||||
|
||||
### Attribution & Other Requirements
|
||||
|
||||
The pretraining dataset of the model was filtered for permissive licenses only. Nevertheless, the model can generate source code verbatim from the dataset. The code's license might require attribution and/or other specific requirements that must be respected. We provide a [search index](https://huggingface.co/spaces/bigcode/starcoder-search) that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
|
||||
|
||||
# Limitations
|
||||
|
||||
The model has been trained on source code from 80+ programming languages. The predominant natural language in source code is English although other languages are also present. As such the model is capable of generating code snippets provided some context but the generated code is not guaranteed to work as intended. It can be inefficient, contain bugs or exploits. See [the paper](https://drive.google.com/file/d/1cN-b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view) for an in-depth discussion of the model limitations.
|
||||
|
||||
# Training
|
||||
|
||||
## Model
|
||||
|
||||
- **Architecture:** GPT-2 model with multi-query attention and Fill-in-the-Middle objective
|
||||
- **Pretraining steps:** 500k
|
||||
- **Pretraining tokens:** 1 trillion
|
||||
- **Precision:** bfloat16
|
||||
|
||||
## Hardware
|
||||
|
||||
- **GPUs:** 128 Tesla A100
|
||||
- **Training time:** 11 days
|
||||
|
||||
## Software
|
||||
|
||||
- **Orchestration:** [Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
|
||||
- **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
|
||||
- **BP16 if applicable:** [apex](https://github.com/NVIDIA/apex)
|
||||
|
||||
# License
|
||||
The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement [here](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement).
|
||||
# Citation
|
||||
```
|
||||
@article{li2023starcoder,
|
||||
title={StarCoder: may the source be with you!},
|
||||
author={Raymond Li and Loubna Ben Allal and Yangtian Zi and Niklas Muennighoff and Denis Kocetkov and Chenghao Mou and Marc Marone and Christopher Akiki and Jia Li and Jenny Chim and Qian Liu and Evgenii Zheltonozhskii and Terry Yue Zhuo and Thomas Wang and Olivier Dehaene and Mishig Davaadorj and Joel Lamy-Poirier and João Monteiro and Oleh Shliazhko and Nicolas Gontier and Nicholas Meade and Armel Zebaze and Ming-Ho Yee and Logesh Kumar Umapathi and Jian Zhu and Benjamin Lipkin and Muhtasham Oblokulov and Zhiruo Wang and Rudra Murthy and Jason Stillerman and Siva Sankalp Patel and Dmitry Abulkhanov and Marco Zocca and Manan Dey and Zhihan Zhang and Nour Fahmy and Urvashi Bhattacharyya and Wenhao Yu and Swayam Singh and Sasha Luccioni and Paulo Villegas and Maxim Kunakov and Fedor Zhdanov and Manuel Romero and Tony Lee and Nadav Timor and Jennifer Ding and Claire Schlesinger and Hailey Schoelkopf and Jan Ebert and Tri Dao and Mayank Mishra and Alex Gu and Jennifer Robinson and Carolyn Jane Anderson and Brendan Dolan-Gavitt and Danish Contractor and Siva Reddy and Daniel Fried and Dzmitry Bahdanau and Yacine Jernite and Carlos Muñoz Ferrandis and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries},
|
||||
year={2023},
|
||||
eprint={2305.06161},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CL}
|
||||
}
|
||||
```
|
||||
39
config.json
Normal file
39
config.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"_name_or_path": "/fsx/bigcode/experiments/pretraining/conversions/starcoder-1b",
|
||||
"activation_function": "gelu_pytorch_tanh",
|
||||
"architectures": [
|
||||
"GPTBigCodeForCausalLM"
|
||||
],
|
||||
"attention_softmax_in_fp32": true,
|
||||
"multi_query": true,
|
||||
"attn_pdrop": 0.1,
|
||||
"bos_token_id": 0,
|
||||
"embd_pdrop": 0.1,
|
||||
"eos_token_id": 0,
|
||||
"inference_runner": 0,
|
||||
"initializer_range": 0.02,
|
||||
"layer_norm_epsilon": 1e-05,
|
||||
"max_batch_size": null,
|
||||
"max_sequence_length": null,
|
||||
"model_type": "gpt_bigcode",
|
||||
"n_embd": 2048,
|
||||
"n_head": 16,
|
||||
"n_inner": 8192,
|
||||
"n_layer": 24,
|
||||
"n_positions": 8192,
|
||||
"pad_key_length": true,
|
||||
"pre_allocate_kv_cache": false,
|
||||
"resid_pdrop": 0.1,
|
||||
"scale_attention_softmax_in_fp32": true,
|
||||
"scale_attn_weights": true,
|
||||
"summary_activation": null,
|
||||
"summary_first_dropout": 0.1,
|
||||
"summary_proj_to_labels": true,
|
||||
"summary_type": "cls_index",
|
||||
"summary_use_proj": true,
|
||||
"torch_dtype": "float32",
|
||||
"transformers_version": "4.28.1",
|
||||
"use_cache": true,
|
||||
"validate_runner_input": true,
|
||||
"vocab_size": 49152
|
||||
}
|
||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
||||
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 0,
|
||||
"eos_token_id": 0,
|
||||
"transformers_version": "4.28.1"
|
||||
}
|
||||
48892
merges.txt
Normal file
48892
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9fdaceae5e9a3dc21d255292490e8db4b008c4ff2ee0693c9edd914d566bd15e
|
||||
size 4548859752
|
||||
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d0d2747ca5eab6c037184ad171739f1eff537cefb7220acbf13347ff55946492
|
||||
size 4548920521
|
||||
26
special_tokens_map.json
Normal file
26
special_tokens_map.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"additional_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<fim_prefix>",
|
||||
"<fim_middle>",
|
||||
"<fim_suffix>",
|
||||
"<fim_pad>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<empty_output>",
|
||||
"<commit_before>",
|
||||
"<commit_msg>",
|
||||
"<commit_after>",
|
||||
"<reponame>"
|
||||
],
|
||||
"bos_token": "<|endoftext|>",
|
||||
"eos_token": "<|endoftext|>",
|
||||
"unk_token": "<|endoftext|>"
|
||||
}
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:42b5a37ba11199f024f2b8873e1ecba98da33166e16f700bf7cb2304b0a5583f
|
||||
size 2057395
|
||||
30
tokenizer_config.json
Normal file
30
tokenizer_config.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"additional_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<fim_prefix>",
|
||||
"<fim_middle>",
|
||||
"<fim_suffix>",
|
||||
"<fim_pad>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<empty_output>",
|
||||
"<commit_before>",
|
||||
"<commit_msg>",
|
||||
"<commit_after>",
|
||||
"<reponame>"
|
||||
],
|
||||
"bos_token": "<|endoftext|>",
|
||||
"eos_token": "<|endoftext|>",
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"tokenizer_class": "GPT2Tokenizer",
|
||||
"unk_token": "<|endoftext|>",
|
||||
"vocab_size": 49152
|
||||
}
|
||||
1
vocab.json
Normal file
1
vocab.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user