Text Generation
Transformers
PyTorch
code
gpt2
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use bigcode/santacoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bigcode/santacoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bigcode/santacoder", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bigcode/santacoder", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("bigcode/santacoder", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bigcode/santacoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bigcode/santacoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigcode/santacoder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bigcode/santacoder
- SGLang
How to use bigcode/santacoder 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/santacoder" \ --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/santacoder", "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/santacoder" \ --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/santacoder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bigcode/santacoder with Docker Model Runner:
docker model run hf.co/bigcode/santacoder
Commit History
-
Update eos_token_id / bos_token_id in config.json (#19)
- Update eos_token_id / bos_token_id in config.json (fb44eff34ade2abe395a5f5108b9f7eb47ead6ee) Co-authored-by: Nick Hill <nickhugs@users.noreply.huggingface.co>0b048f3
-
Activate inference API (#26)
- Activate inference API (2db39c32a50de482252ba601e9ee9db83fba5ab4) Co-authored-by: Olivier Dehaene <olivierdehaene@users.noreply.huggingface.co>6a4fb77
-
Fix link (#24)
- Fix link (458d837e9a8a47df959ffdf55e45a322390f5a77) Co-authored-by: Kento Nozawa <nzw0301@users.noreply.huggingface.co>bb63c0e
-
Fix char typo in README (#20)
- Fix char typo in README (5da99123c4a54aeb013a9eda0f4f8b5ff37cd0d5) Co-authored-by: Romain Rigaux <iquery@users.noreply.huggingface.co>e464072
-
Fix typo (#16)
- Fix typo (b110e2b5f45658e32302b82cfe4840d10081044b) Co-authored-by: Manuel Romero <mrm8488@users.noreply.huggingface.co>636ad0a
-
Switch from PreTrainedTokenizerFast to GPT2TokenizerFast and add eos_token & bos_token (#15)
- Switch from PreTrainedTokenizerFast to GPT2TokenizerFast and add eos_token & bos_token (d63779a667c4e0bd0d06f385b407c0c649b36454)47ad9f0
-
Update tokenizer (#11)
- add special tokens (1354bdd629179fb09a56394c65253a0748c68258) Co-authored-by: Raymond Li <RaymondLi@users.noreply.huggingface.co>cd86b97
-
update paper link to arxiv
3482bf4 -
Update README with citation (#12)
- Update README with citation (c00c8fdac002fc6c30ec6acf1a5eb2d389d242bc) Co-authored-by: Nathan Cooper <ncoop57@users.noreply.huggingface.co>bb6706d
-
Add max length to tokenizer
aaeed52
-
Update README.md
cfee4c0 -
Update configuration_gpt2_mq.py (#6)
- Update configuration_gpt2_mq.py (245055f1af20b9e73ba6c4659fdac815d889db11) Co-authored-by: Ikko Ashimine <eltociear@users.noreply.huggingface.co>79d9bea -
add link to the paper (#7)
- add link to the paper (6913366770f3887961f5ac649a69403b57753329)959bf80
-
link to space (#5)
- link to space (d58cb6255110a028b6f24af89373b2d28b6762bc) Co-authored-by: Thomas Wolf <thomwolf@users.noreply.huggingface.co>baec3a0 -
Fix model device in code example (#4)
- Fix model device in code example (02bda2ccbdc90faf06bebe95175e2a9f5f75be5c) Co-authored-by: Lewis Tunstall <lewtun@users.noreply.huggingface.co>3d4d383 -
Update README.md
d3c3868 -
Update README.md
e02c7b7 -
Update README.md
718da24 -
Update README.md
bdeb6cc -
Update model card Attribution Section (#3)
- Update model card Attribution Section (c357fb5a74bb93c4cb4e012cad8bd8b10e96d88b) Co-authored-by: Carlos Muñoz Ferrandis <CarlosMF@users.noreply.huggingface.co>fa6c997 -
Update README.md
bf8ac45 -
Merge branch 'dedup-alt-comments'
leandro26708d1
-
Update README.md
417a7b1 -
Update README.md
600be72 -
Update README.md
f6b437c -
Update README.md
68ead1d -
Update README.md
052c6ae -
Update README.md
fc6b64b
-
Update README.md
bca2f60 -
Create README.md
96a5500 -
iter_0600000
080e3b8
-
iter_0560000
9304dee -
iter_0520000
88daff8 -
iter_0480000
208293c -
iter_0440000
711c1f9 -
iter_0400000
3a4ecf6 -
iter_0360000
94de3b2 -
iter_0320000
a39929f -
iter_0280000
1288849 -
iter_0240000
1a512a2 -
iter_0200000
6fa0065 -
iter_0160000
f72811f -
iter_0120000
e69ad90 -
iter_0080000
d9a7ac2 -
iter_0040000
b6b7dd5
-
Upload tokenizer
ebb180e
-
Update modeling_gpt2_mq.py
094f6ad -
Update modeling_gpt2_mq.py
55a1ff8 -
Upload 2 files
5fb20b0 -
initial commit
ab5ccc2