Text Generation
Transformers
PyTorch
gpt_bigcode
fill-mask
code
Eval Results (legacy)
text-generation-inference
Run this model with HF Jobs
Run bigcode/santacoderpack on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/bigcode/santacoderpack. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/bigcode/santacoderpack on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/bigcode/santacoderpack. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/bigcode/santacoderpack. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use bigcode/santacoderpack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bigcode/santacoderpack with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bigcode/santacoderpack")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelWithLMHead tokenizer = AutoTokenizer.from_pretrained("bigcode/santacoderpack") model = AutoModelWithLMHead.from_pretrained("bigcode/santacoderpack", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bigcode/santacoderpack with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bigcode/santacoderpack" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigcode/santacoderpack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bigcode/santacoderpack
- SGLang
How to use bigcode/santacoderpack with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "bigcode/santacoderpack" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigcode/santacoderpack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "bigcode/santacoderpack" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigcode/santacoderpack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bigcode/santacoderpack with Docker Model Runner:
docker model run hf.co/bigcode/santacoderpack
update readme
Browse files123---license: bigcode-openrail-m---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170---pipeline_tag: text-generationinference: truewidget:- text: '<commit_before>def has_close_elements(numbers: List[float], threshold: float) -> bool:\n for idx, elem in enumerate(numbers):\n for idx2, elem2 in enumerate(numbers):\n if idx != idx2:\n distance = elem - elem2\n if distance < threshold:\n return True\n\n return False<commit_message>Fix bugs in has_close_elements.<commit_after>'example_title: Fix has_close_elementsgroup: Pythonlicense: bigcode-openrail-mdatasets:- bigcode/commits-8129-v2metrics:- code_evallibrary_name: transformerstags:- codemodel-index:- name: SantaCoderPackresults:- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix Pythonmetrics:- name: pass@1type: pass@1value: 3.2verified: false- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix JavaScriptmetrics:- name: pass@1type: pass@1value: 4.9verified: false- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix Javametrics:- name: pass@1type: pass@1value: 1.8verified: false- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix Gometrics:- name: pass@1type: pass@1value: 3.6verified: false- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix C++metrics:- name: pass@1type: pass@1value: 4.2verified: false- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix Rustmetrics:- name: pass@1type: pass@1value: 1.7verified: false- task:type: text-generationdataset:type: bigcode/humanevalpackname: HumanEvalFix Averagemetrics:- name: pass@1type: pass@1value: 3.3verified: false---# Table of Contents1. [Model Summary](#model-summary)2. [Use](#use)3. [Training](#training)4. [Citation](#citation)# Model SummarySantaCoderPack is an pre-trained model with the same architecture of SantaCoder on<th><a href=https://huggingface.co/datasets/bigcode/commitpack>CommitPack</a> using this format: `<commit_before>code_before<commit_msg>message<commit_after>`- **Repository:** [bigcode/octopack](https://github.com/bigcode-project/octopack)- **Paper:** [TODO]()- **Languages:** Python, JavaScript, Java, C++, Go, Rust- **SantaCoderPack:**<table><tr><th>Data</t><th><a href=https://huggingface.co/datasets/bigcode/commitpack>CommitPack</a></th><td>4TB of GitHub commits across 350 programming languages</td></tr><tr><th>Model</t><th><a href=https://huggingface.co/bigcode/octocoder>SantaCoderPack</a></th><td>SantaCoderPack (1.1B parameters) pre-trained on CommitPack</td></tr><tr><th>Evaluation </t><th><a href=https://huggingface.co/datasets/bigcode/humanevalpack>HumanEvalPack/HumanEvalFix</a></th><td>Extension of OpenAI's HumanEval to HumanEvalFix</td></tr></table># Use## Intended useThe model follows instructions provided in the input. We recommend prefacing your input with "<commit_before>def has_close_elements(numbers: List[float], threshold: float) -> bool:\n for idx, elem in enumerate(numbers):\n for idx2, elem2 in enumerate(numbers):\n if idx != idx2:\n distance = elem - elem2\n if distance < threshold:\n return True\n\n return False<commit_message>Fix bugs in has_close_elements.<commit_after>"**Feel free to share your generations in the Community tab!**## Generation```python# pip install -q transformersfrom transformers import AutoModelForCausalLM, AutoTokenizercheckpoint = "bigcode/santacoderpack"device = "cuda" # for GPU usage or "cpu" for CPU usagetokenizer = AutoTokenizer.from_pretrained(checkpoint)model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)inputs = tokenizer.encode("Q<commit_before>def has_close_elements(numbers: List[float], threshold: float) -> bool:\n for idx, elem in enumerate(numbers):\n for idx2, elem2 in enumerate(numbers):\n if idx != idx2:\n distance = elem - elem2\n if distance < threshold:\n return True\n\n return False<commit_message>Fix bugs in has_close_elements.<commit_after>", return_tensors="pt").to(device)outputs = model.generate(inputs)print(tokenizer.decode(outputs[0]))```# Training## Model- **Architecture:** GPT-2 model with multi-query attention- **Steps:** 250k pretraining- **Pretraining tokens:** 131B- **Precision:** bfloat16## Hardware- **Pretraining:**- **GPUs:** 32 Tesla A100- **Training time:** 15 days## Software- **Orchestration:** [Megatron-LM/Transformers](https://github.com/bigcode-project/santacoderpack#training)- **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)# CitationTODO
README.md+167