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 config and model (new modeling)
Browse files- config.json +19 -31
- pytorch_model.bin +2 -2
config.json
CHANGED
|
@@ -1,35 +1,23 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
"
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
"resid_pdrop": 0.1,
|
| 22 |
-
"rotary_embedding_scale": -13.81551,
|
| 23 |
-
"scale_attention_softmax_in_fp32": true,
|
| 24 |
-
"scale_attn_weights": true,
|
| 25 |
-
"summary_activation": null,
|
| 26 |
-
"summary_first_dropout": 0.1,
|
| 27 |
-
"summary_proj_to_labels": true,
|
| 28 |
-
"summary_type": "cls_index",
|
| 29 |
-
"summary_use_proj": true,
|
| 30 |
-
"transformers_version": "4.34.1",
|
| 31 |
"use_cache": true,
|
| 32 |
-
"use_position_embeddings": false,
|
| 33 |
-
"use_rotary_embeddings": true,
|
| 34 |
"vocab_size": 49152
|
| 35 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"attention_dropout": 0.0,
|
| 3 |
+
"bos_token_id": 50256,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 6 |
+
"hidden_size": 3072,
|
| 7 |
+
"initializer_range": 0.018042,
|
| 8 |
+
"intermediate_size": 12288,
|
| 9 |
+
"max_position_embeddings": 16384,
|
| 10 |
+
"mlp_type": "default",
|
| 11 |
+
"model_type": "starcoder2",
|
| 12 |
+
"norm_epsilon": 1e-05,
|
| 13 |
+
"norm_type": "layer_norm",
|
| 14 |
+
"num_attention_heads": 24,
|
| 15 |
+
"num_hidden_layers": 30,
|
| 16 |
+
"num_key_value_heads": 2,
|
| 17 |
+
"rope_theta": 999999.4420358813,
|
| 18 |
+
"sliding_window": 4096,
|
| 19 |
+
"transformers_version": "4.37.0.dev0",
|
| 20 |
+
"use_bias": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
"use_cache": true,
|
|
|
|
|
|
|
| 22 |
"vocab_size": 49152
|
| 23 |
}
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c6d17296643c062e7fcd59b4904e3410909292ae042c4c6be9bcdd6430a36080
|
| 3 |
+
size 23731378826
|