Text Generation
Transformers
Safetensors
starcoder2
code
Eval Results (legacy)
text-generation-inference
Instructions to use bigcode/starcoder2-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bigcode/starcoder2-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bigcode/starcoder2-3b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-3b") model = AutoModelForCausalLM.from_pretrained("bigcode/starcoder2-3b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bigcode/starcoder2-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bigcode/starcoder2-3b" # 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-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bigcode/starcoder2-3b
- SGLang
How to use bigcode/starcoder2-3b 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-3b" \ --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-3b", "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-3b" \ --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-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bigcode/starcoder2-3b with Docker Model Runner:
docker model run hf.co/bigcode/starcoder2-3b
Commit History
-
Adding Evaluation Results
Verified signatureThis is an automated PR created with https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-results-pr The purpose of this PR is to add evaluation results from the Open LLM Leaderboard to your model card. If you encounter any issues, please report them to https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-results-pr/discussions364e7f5
-
add dropout (#6)
Verified signature- add dropout (fd801e8f623554883a151c6b9b25a66fe8b3231c) Co-authored-by: Loubna Ben Allal <loubnabnl@users.noreply.huggingface.co>733247c
-
fix paper (#3)
Verified signature- fix paper (39cf25ead144fbb3576134388a07fa33cff731ff)cc9b0d4
-
Add architectures field to config.json (#2)
Verified signature- Add architectures field to config.json (df35d7804fd0ec8d5d62b9a31a9054037333c558) Co-authored-by: Charles Goddard <chargoddard@users.noreply.huggingface.co>54da767
-
Update README.md
Verified signature444cd6f
-
Update README.md (#1)
Verified signature- Update README.md (045118a53b7c5f9b375bf15aac797e3eb4c84feb) - add humaneval (adbc2c4071e9942baa55c27738854ca2f5fbe851) Co-authored-by: Leandro von Werra <lvwerra@users.noreply.huggingface.co>4e1a8cf -
Update README.md
Verified signature421d645 -
rewrite
Verified signature73551f5 -
Update README.md
Verified signature107effb -
Update README.md
Verified signature2cdb3d3
-
Create README.md
Verified signature088e2ed -
fix eos token
Verified signature8f2ca22 -
add missing tokenizer files
6af7c4b
-
safetensors
56b73d9
-
remove obsolete info in readme
9eebcd0 -
update config and model (new modeling)
f14327e
-
Update README.md
Verified signature11a6bb4 -
Create README.md
Verified signatured65d24c
-
Upload tokenizer.json
b75eb95 -
50000
9a1f939 -
initial commit
09a9c4c