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)# 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) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
---
|
| 2 |
-
license: openrail
|
| 3 |
datasets:
|
| 4 |
- bigcode/the-stack
|
| 5 |
language:
|
| 6 |
- code
|
| 7 |
-
programming_language:
|
| 8 |
- Java
|
| 9 |
- JavaScript
|
| 10 |
- Python
|
|
@@ -14,7 +14,6 @@ widget:
|
|
| 14 |
- text: 'def print_hello_world():'
|
| 15 |
example_title: Hello world
|
| 16 |
group: Python
|
| 17 |
-
|
| 18 |
model-index:
|
| 19 |
- name: SantaCoder
|
| 20 |
results:
|
|
@@ -88,7 +87,7 @@ model-index:
|
|
| 88 |
verified: false
|
| 89 |
- name: pass@100
|
| 90 |
type: pass@100
|
| 91 |
-
value: 0.
|
| 92 |
verified: false
|
| 93 |
- task:
|
| 94 |
type: text-generation
|
|
@@ -154,7 +153,7 @@ model-index:
|
|
| 154 |
metrics:
|
| 155 |
- name: single_line
|
| 156 |
type: exact_match
|
| 157 |
-
value: 0.
|
| 158 |
verified: false
|
| 159 |
- task:
|
| 160 |
type: text-generation
|
|
|
|
| 1 |
---
|
| 2 |
+
license: bigcode-openrail-m
|
| 3 |
datasets:
|
| 4 |
- bigcode/the-stack
|
| 5 |
language:
|
| 6 |
- code
|
| 7 |
+
programming_language:
|
| 8 |
- Java
|
| 9 |
- JavaScript
|
| 10 |
- Python
|
|
|
|
| 14 |
- text: 'def print_hello_world():'
|
| 15 |
example_title: Hello world
|
| 16 |
group: Python
|
|
|
|
| 17 |
model-index:
|
| 18 |
- name: SantaCoder
|
| 19 |
results:
|
|
|
|
| 87 |
verified: false
|
| 88 |
- name: pass@100
|
| 89 |
type: pass@100
|
| 90 |
+
value: 0.7
|
| 91 |
verified: false
|
| 92 |
- task:
|
| 93 |
type: text-generation
|
|
|
|
| 153 |
metrics:
|
| 154 |
- name: single_line
|
| 155 |
type: exact_match
|
| 156 |
+
value: 0.6
|
| 157 |
verified: false
|
| 158 |
- task:
|
| 159 |
type: text-generation
|