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
-
Activate inference API
2db39c3
-
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
-
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
-
Update README.md
cfee4c0 -
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
-
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