Text Generation
Transformers
Safetensors
starcoder2
code
Eval Results (legacy)
text-generation-inference
Instructions to use bigcode/starcoder2-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bigcode/starcoder2-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bigcode/starcoder2-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-7b") model = AutoModelForCausalLM.from_pretrained("bigcode/starcoder2-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bigcode/starcoder2-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bigcode/starcoder2-7b" # 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-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bigcode/starcoder2-7b
- SGLang
How to use bigcode/starcoder2-7b 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-7b" \ --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-7b", "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-7b" \ --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-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bigcode/starcoder2-7b with Docker Model Runner:
docker model run hf.co/bigcode/starcoder2-7b
- Downloads last month
- 11,967
Model tree for bigcode/starcoder2-7b
Dataset used to train bigcode/starcoder2-7b
Viewer β’ Updated β’ 60.5M β’ 528 β’ 60
Spaces using bigcode/starcoder2-7b 50
bigcode/bigcode-models-leaderboard
π»
FallnAI/Quantize-HF-Models
π
openfree/LLM_Quantization
π
lhs9101/starvector-1b-im2svg
π
Justinrune/LLaMA-Factory
Collection including bigcode/starcoder2-7b
Papers for bigcode/starcoder2-7b
StarCoder 2 and The Stack v2: The Next Generation
Paper β’ 2402.19173 β’ Published β’ 156
GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints
Paper β’ 2305.13245 β’ Published β’ 6
Efficient Training of Language Models to Fill in the Middle
Paper β’ 2207.14255 β’ Published β’ 1
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
Paper β’ 2205.14135 β’ Published β’ 15
Longformer: The Long-Document Transformer
Paper β’ 2004.05150 β’ Published β’ 4
Evaluation results
- pass@1 on CruxEval-Iself-reported34.600
- pass@1 on DS-1000self-reported27.800
- accuracy on GSM8K (PAL)self-reported40.400
- pass@1 on HumanEval+self-reported29.900
- pass@1 on HumanEvalself-reported35.400
- edit-smiliarity on RepoBench-v1.1self-reported72.070
docker model run hf.co/bigcode/starcoder2-7b