Text Generation
Transformers
Safetensors
starcoder2
code
Eval Results (legacy)
text-generation-inference
Run this model with HF Jobs
Run bigcode/starcoder2-15b 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/starcoder2-15b. 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/starcoder2-15b 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/starcoder2-15b. 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/starcoder2-15b. 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/starcoder2-15b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bigcode/starcoder2-15b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bigcode/starcoder2-15b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-15b") model = AutoModelForCausalLM.from_pretrained("bigcode/starcoder2-15b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bigcode/starcoder2-15b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bigcode/starcoder2-15b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigcode/starcoder2-15b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bigcode/starcoder2-15b
- SGLang
How to use bigcode/starcoder2-15b 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/starcoder2-15b" \ --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/starcoder2-15b", "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/starcoder2-15b" \ --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/starcoder2-15b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bigcode/starcoder2-15b with Docker Model Runner:
docker model run hf.co/bigcode/starcoder2-15b
Adding Evaluation Results
#28
by leaderboard-pr-bot - opened
12343 unmodified lines891011121314151617181945 unmodified lines656667686970141 unmodified lines212213214215---pipeline_tag: text-generationinference:parameters:3 unmodified lines- text: 'def print_hello_world():'example_title: Hello worldgroup: Pythondatasets:- bigcode/the-stack-v2-trainlicense: bigcode-openrail-mlibrary_name: transformerstags:- codemodel-index:- name: starcoder2-15bresults:45 unmodified linesmetrics:- type: edit-smiliarityvalue: 74.08---# StarCoder2141 unmodified linesarchivePrefix={arXiv},primaryClass={cs.SE}}```123456789103 unmodified lines14151617181945 unmodified lines6566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162141 unmodified lines304305306307308309310311312313314315316317318319320---license: bigcode-openrail-mlibrary_name: transformerstags:- codedatasets:- bigcode/the-stack-v2-trainpipeline_tag: text-generationinference:parameters:3 unmodified lines- text: 'def print_hello_world():'example_title: Hello worldgroup: Pythonmodel-index:- name: starcoder2-15bresults:45 unmodified linesmetrics:- type: edit-smiliarityvalue: 74.08- task:type: text-generationname: Text Generationdataset:name: IFEval (0-Shot)type: HuggingFaceH4/ifevalargs:num_few_shot: 0metrics:- type: inst_level_strict_acc and prompt_level_strict_accvalue: 27.35name: strict accuracysource:url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=bigcode/starcoder2-15bname: Open LLM Leaderboard- task:type: text-generationname: Text Generationdataset:name: BBH (3-Shot)type: BBHargs:num_few_shot: 3metrics:- type: acc_normvalue: 20.24name: normalized accuracysource:url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=bigcode/starcoder2-15bname: Open LLM Leaderboard- task:type: text-generationname: Text Generationdataset:name: MATH Lvl 5 (4-Shot)type: hendrycks/competition_mathargs:num_few_shot: 4metrics:- type: exact_matchvalue: 4.83name: exact matchsource:url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=bigcode/starcoder2-15bname: Open LLM Leaderboard- task:type: text-generationname: Text Generationdataset:name: GPQA (0-shot)type: Idavidrein/gpqaargs:num_few_shot: 0metrics:- type: acc_normvalue: 2.91name: acc_normsource:url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=bigcode/starcoder2-15bname: Open LLM Leaderboard- task:type: text-generationname: Text Generationdataset:name: MuSR (0-shot)type: TAUR-Lab/MuSRargs:num_few_shot: 0metrics:- type: acc_normvalue: 2.93name: acc_normsource:url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=bigcode/starcoder2-15bname: Open LLM Leaderboard- task:type: text-generationname: Text Generationdataset:name: MMLU-PRO (5-shot)type: TIGER-Lab/MMLU-Proconfig: mainsplit: testargs:num_few_shot: 5metrics:- type: accvalue: 15.03name: accuracysource:url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=bigcode/starcoder2-15bname: Open LLM Leaderboard---# StarCoder2141 unmodified linesarchivePrefix={arXiv},primaryClass={cs.SE}}```# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard)Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_bigcode__starcoder2-15b)| Metric |Value||-------------------|----:||Avg. |12.21||IFEval (0-Shot) |27.35||BBH (3-Shot) |20.24||MATH Lvl 5 (4-Shot)| 4.83||GPQA (0-shot) | 2.91||MuSR (0-shot) | 2.93||MMLU-PRO (5-shot) |15.03|
README.md+112-7