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
Create README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168---license: todolanguage:- codeprogramming_language: - Java- JavaScript- Pythonpipeline_tag: text-generationwidget:- text: 'def print_hello_world():' example_title: Hello world group: Python
model-index:- name: SantaCoder results: - task: type: text-generation dataset: type: openai_humaneval name: HumanEval (Python) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 verified: false dataset: type: nuprl/MultiPL-E name: MultiPL HumanEval (Java) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 dataset: type: nuprl/MultiPL-E name: MultiPL HumanEval (JavaScript) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 dataset: type: openai_humaneval name: MBPP (Python) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 verified: false dataset: type: nuprl/MultiPL-E name: MultiPL MBPP (Java) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 dataset: type: nuprl/MultiPL-E name: MultiPL MBPP (JavaScript) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 dataset: type: loubnabnl/humaneval_infilling name: HumanEval FIM (Python) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 verified: false dataset: type: nuprl/MultiPL-E name: MultiPL HumanEval FIM (Java) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 dataset: type: nuprl/MultiPL-E name: MultiPL HumanEval FIM (JavaScript) metrics: - name: pass@1 type: pass@1 value: 0.0 verified: false - name: pass@10 type: pass@10 value: 0.0 verified: false - name: pass@100 type: pass@100 value: 0.0 dataset: type: code_x_glue_ct_code_to_text name: CodeXGLUE code-to-text (Python) metrics: - name: BLEU type: bleu value: 0.0 verified: false
# SantaCoder
README.mdAdded+168