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")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-3b") model = AutoModelForCausalLM.from_pretrained("bigcode/starcoder2-3b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
Update README.md
#1
by lvwerra HF Staff - opened
README.md
CHANGED
|
@@ -11,6 +11,57 @@ license: bigcode-openrail-m
|
|
| 11 |
library_name: transformers
|
| 12 |
tags:
|
| 13 |
- code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
# StarCoder2
|
|
|
|
| 11 |
library_name: transformers
|
| 12 |
tags:
|
| 13 |
- code
|
| 14 |
+
model-index:
|
| 15 |
+
- name: starcoder2-3b
|
| 16 |
+
results:
|
| 17 |
+
- task:
|
| 18 |
+
type: text-generation
|
| 19 |
+
dataset:
|
| 20 |
+
name: CruxEval-I
|
| 21 |
+
type: cruxeval-i
|
| 22 |
+
metrics:
|
| 23 |
+
- type: pass@1
|
| 24 |
+
value: 32.7
|
| 25 |
+
- task:
|
| 26 |
+
type: text-generation
|
| 27 |
+
dataset:
|
| 28 |
+
name: DS-1000
|
| 29 |
+
type: ds-1000
|
| 30 |
+
metrics:
|
| 31 |
+
- type: pass@1
|
| 32 |
+
value: 25.0
|
| 33 |
+
- task:
|
| 34 |
+
type: text-generation
|
| 35 |
+
dataset:
|
| 36 |
+
name: GSM8K (PAL)
|
| 37 |
+
type: gsm8k-pal
|
| 38 |
+
metrics:
|
| 39 |
+
- type: accuracy
|
| 40 |
+
value: 27.7
|
| 41 |
+
- task:
|
| 42 |
+
type: text-generation
|
| 43 |
+
dataset:
|
| 44 |
+
name: HumanEval+
|
| 45 |
+
type: humanevalplus
|
| 46 |
+
metrics:
|
| 47 |
+
- type: pass@1
|
| 48 |
+
value: 27.4
|
| 49 |
+
- task:
|
| 50 |
+
type: text-generation
|
| 51 |
+
dataset:
|
| 52 |
+
name: HumanEval
|
| 53 |
+
type: humaneval
|
| 54 |
+
metrics:
|
| 55 |
+
- type: pass@1
|
| 56 |
+
value: 31.7
|
| 57 |
+
- task:
|
| 58 |
+
type: text-generation
|
| 59 |
+
dataset:
|
| 60 |
+
name: RepoBench-v1.1
|
| 61 |
+
type: repobench-v1.1
|
| 62 |
+
metrics:
|
| 63 |
+
- type: edit-smiliarity
|
| 64 |
+
value: 71.19
|
| 65 |
---
|
| 66 |
|
| 67 |
# StarCoder2
|