RichardErkhov / bigcode_-_starcoder2-7b-gguf

huggingface.co
Total runs: 617
24-hour runs: -14
7-day runs: 37
30-day runs: -255
Model's Last Updated: May 10 2024

Introduction of bigcode_-_starcoder2-7b-gguf

Model Details of bigcode_-_starcoder2-7b-gguf

Quantization made by Richard Erkhov.

Github

Discord

Request more models

starcoder2-7b - GGUF

Name Quant method Size
starcoder2-7b.Q2_K.gguf Q2_K 2.64GB
starcoder2-7b.IQ3_XS.gguf IQ3_XS 2.85GB
starcoder2-7b.IQ3_S.gguf IQ3_S 2.97GB
starcoder2-7b.Q3_K_S.gguf Q3_K_S 2.96GB
starcoder2-7b.IQ3_M.gguf IQ3_M 3.1GB
starcoder2-7b.Q3_K.gguf Q3_K 3.41GB
starcoder2-7b.Q3_K_M.gguf Q3_K_M 3.41GB
starcoder2-7b.Q3_K_L.gguf Q3_K_L 3.79GB
starcoder2-7b.IQ4_XS.gguf IQ4_XS 3.68GB
starcoder2-7b.Q4_0.gguf Q4_0 3.82GB
starcoder2-7b.IQ4_NL.gguf IQ4_NL 3.87GB
starcoder2-7b.Q4_K_S.gguf Q4_K_S 3.86GB
starcoder2-7b.Q4_K.gguf Q4_K 4.15GB
starcoder2-7b.Q4_K_M.gguf Q4_K_M 4.15GB
starcoder2-7b.Q4_1.gguf Q4_1 4.22GB
starcoder2-7b.Q5_0.gguf Q5_0 4.63GB
starcoder2-7b.Q5_K_S.gguf Q5_K_S 4.63GB
starcoder2-7b.Q5_K.gguf Q5_K 4.8GB
starcoder2-7b.Q5_K_M.gguf Q5_K_M 4.8GB
starcoder2-7b.Q5_1.gguf Q5_1 5.03GB
starcoder2-7b.Q6_K.gguf Q6_K 5.49GB
Original model description:
pipeline_tag: text-generation inference: parameters: temperature: 0.2 top_p: 0.95 widget: - text: 'def print_hello_world():' example_title: Hello world group: Python datasets: - bigcode/the-stack-v2-train license: bigcode-openrail-m library_name: transformers tags: - code model-index: - name: starcoder2-7b results: - task: type: text-generation dataset: name: CruxEval-I type: cruxeval-i metrics: - type: pass@1 value: 34.6 - task: type: text-generation dataset: name: DS-1000 type: ds-1000 metrics: - type: pass@1 value: 27.8 - task: type: text-generation dataset: name: GSM8K (PAL) type: gsm8k-pal metrics: - type: accuracy value: 40.4 - task: type: text-generation dataset: name: HumanEval+ type: humanevalplus metrics: - type: pass@1 value: 29.9 - task: type: text-generation dataset: name: HumanEval type: humaneval metrics: - type: pass@1 value: 35.4 - task: type: text-generation dataset: name: RepoBench-v1.1 type: repobench-v1.1 metrics: - type: edit-smiliarity value: 72.07

StarCoder2

SC2
Table of Contents
  1. Model Summary
  2. Use
  3. Limitations
  4. Training
  5. License
  6. Citation
Model Summary

StarCoder2-7B model is a 7B parameter model trained on 17 programming languages from The Stack v2 , with opt-out requests excluded. The model uses Grouped Query Attention , a context window of 16,384 tokens with a sliding window attention of 4,096 tokens , and was trained using the Fill-in-the-Middle objective on 3.5+ trillion tokens.

Use
Intended use

The model was trained on GitHub code as well as additional selected data sources such as Arxiv and Wikipedia. As such it is not an instruction model and commands like "Write a function that computes the square root." do not work well.

Generation

Here are some examples to get started with the model. You can find a script for fine-tuning in StarCoder2's GitHub repository .

First, make sure to install transformers from source:

pip install git+https://github.com/huggingface/transformers.git
Running the model on CPU/GPU/multi GPU
  • Using full precision
# pip install git+https://github.com/huggingface/transformers.git # TODO: merge PR to main
from transformers import AutoModelForCausalLM, AutoTokenizer

checkpoint = "bigcode/starcoder2-7b"
device = "cuda" # for GPU usage or "cpu" for CPU usage

tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
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]))
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 29232.57 MB
  • Using torch.bfloat16
# pip install accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

checkpoint = "bigcode/starcoder2-7b"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)

# for fp16 use `torch_dtype=torch.float16` instead
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)

inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 14616.29 MB
Quantized Versions through bitsandbytes
  • Using 8-bit precision (int8)
# pip install bitsandbytes accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig

# to use 4bit use `load_in_4bit=True` instead
quantization_config = BitsAndBytesConfig(load_in_8bit=True)

checkpoint = "bigcode/starcoder2-7b"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint, quantization_config=quantization_config)

inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
# load_in_8bit
Memory footprint: 7670.52 MB
# load_in_4bit
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 4197.64 MB
Attribution & Other Requirements

The pretraining dataset of the model was filtered for permissive licenses and code with no license 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 that lets you search through the pretraining data to identify where the generated code came from and apply the proper attribution to your code.

Limitations

The model has been trained on source code from 17 programming languages. The predominant language in source 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 and contain bugs or exploits. See the paper for an in-depth discussion of the model limitations.

Training

Model
  • Architecture: Transformer decoder with grouped-query and sliding window attention and Fill-in-the-Middle objective
  • Pretraining steps: 1 million
  • Pretraining tokens: 3.5+ trillion
  • Precision: bfloat16
Hardware
  • GPUs: 432 H100
Software

License

The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement here .

Citation

@misc{lozhkov2024starcoder,
      title={StarCoder 2 and The Stack v2: The Next Generation}, 
      author={Anton Lozhkov and Raymond Li and Loubna Ben Allal and Federico Cassano and Joel Lamy-Poirier and Nouamane Tazi and Ao Tang and Dmytro Pykhtar and Jiawei Liu and Yuxiang Wei and Tianyang Liu and Max Tian and Denis Kocetkov and Arthur Zucker and Younes Belkada and Zijian Wang and Qian Liu and Dmitry Abulkhanov and Indraneil Paul and Zhuang Li and Wen-Ding Li and Megan Risdal and Jia Li and Jian Zhu and Terry Yue Zhuo and Evgenii Zheltonozhskii and Nii Osae Osae Dade and Wenhao Yu and Lucas Krauß and Naman Jain and Yixuan Su and Xuanli He and Manan Dey and Edoardo Abati and Yekun Chai and Niklas Muennighoff and Xiangru Tang and Muhtasham Oblokulov and Christopher Akiki and Marc Marone and Chenghao Mou and Mayank Mishra and Alex Gu and Binyuan Hui and Tri Dao and Armel Zebaze and Olivier Dehaene and Nicolas Patry and Canwen Xu and Julian McAuley and Han Hu and Torsten Scholak and Sebastien Paquet and Jennifer Robinson and Carolyn Jane Anderson and Nicolas Chapados and Mostofa Patwary and Nima Tajbakhsh and Yacine Jernite and Carlos Muñoz Ferrandis and Lingming Zhang and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries},
      year={2024},
      eprint={2402.19173},
      archivePrefix={arXiv},
      primaryClass={cs.SE}
}

Runs of RichardErkhov bigcode_-_starcoder2-7b-gguf on huggingface.co

617
Total runs
-14
24-hour runs
86
3-day runs
37
7-day runs
-255
30-day runs

More Information About bigcode_-_starcoder2-7b-gguf huggingface.co Model

bigcode_-_starcoder2-7b-gguf huggingface.co

bigcode_-_starcoder2-7b-gguf huggingface.co is an AI model on huggingface.co that provides bigcode_-_starcoder2-7b-gguf's model effect (), which can be used instantly with this RichardErkhov bigcode_-_starcoder2-7b-gguf model. huggingface.co supports a free trial of the bigcode_-_starcoder2-7b-gguf model, and also provides paid use of the bigcode_-_starcoder2-7b-gguf. Support call bigcode_-_starcoder2-7b-gguf model through api, including Node.js, Python, http.

bigcode_-_starcoder2-7b-gguf huggingface.co Url

https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-7b-gguf

RichardErkhov bigcode_-_starcoder2-7b-gguf online free

bigcode_-_starcoder2-7b-gguf huggingface.co is an online trial and call api platform, which integrates bigcode_-_starcoder2-7b-gguf's modeling effects, including api services, and provides a free online trial of bigcode_-_starcoder2-7b-gguf, you can try bigcode_-_starcoder2-7b-gguf online for free by clicking the link below.

RichardErkhov bigcode_-_starcoder2-7b-gguf online free url in huggingface.co:

https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-7b-gguf

bigcode_-_starcoder2-7b-gguf install

bigcode_-_starcoder2-7b-gguf is an open source model from GitHub that offers a free installation service, and any user can find bigcode_-_starcoder2-7b-gguf on GitHub to install. At the same time, huggingface.co provides the effect of bigcode_-_starcoder2-7b-gguf install, users can directly use bigcode_-_starcoder2-7b-gguf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

bigcode_-_starcoder2-7b-gguf install url in huggingface.co:

https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-7b-gguf

Url of bigcode_-_starcoder2-7b-gguf

bigcode_-_starcoder2-7b-gguf huggingface.co Url

Provider of bigcode_-_starcoder2-7b-gguf huggingface.co

RichardErkhov
ORGANIZATIONS

Other API from RichardErkhov