Instructions to use facebook/incoder-6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/incoder-6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/incoder-6B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/incoder-6B") model = AutoModelForCausalLM.from_pretrained("facebook/incoder-6B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use facebook/incoder-6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/incoder-6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "facebook/incoder-6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/incoder-6B
- SGLang
How to use facebook/incoder-6B 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 "facebook/incoder-6B" \ --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": "facebook/incoder-6B", "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 "facebook/incoder-6B" \ --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": "facebook/incoder-6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/incoder-6B with Docker Model Runner:
docker model run hf.co/facebook/incoder-6B
add model
Browse files- config.json +27 -0
- pytorch_model-00001-of-00003.bin +3 -0
- pytorch_model-00002-of-00003.bin +3 -0
- pytorch_model-00003-of-00003.bin +3 -0
- pytorch_model.bin.index.json +3 -0
config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "/private/home/dpf/models/incoder-6B-hf/",
|
| 3 |
+
"activation_dropout": 0.0,
|
| 4 |
+
"activation_function": "gelu",
|
| 5 |
+
"architectures": [
|
| 6 |
+
"XGLMForCausalLM"
|
| 7 |
+
],
|
| 8 |
+
"attention_dropout": 0.1,
|
| 9 |
+
"attention_heads": 32,
|
| 10 |
+
"bos_token_id": 0,
|
| 11 |
+
"d_model": 4096,
|
| 12 |
+
"decoder_start_token_id": 2,
|
| 13 |
+
"dropout": 0.0,
|
| 14 |
+
"eos_token_id": 2,
|
| 15 |
+
"ffn_dim": 16384,
|
| 16 |
+
"init_std": 0.02,
|
| 17 |
+
"layerdrop": 0.0,
|
| 18 |
+
"max_position_embeddings": 2049,
|
| 19 |
+
"model_type": "xglm",
|
| 20 |
+
"num_layers": 32,
|
| 21 |
+
"pad_token_id": 1,
|
| 22 |
+
"scale_embedding": true,
|
| 23 |
+
"torch_dtype": "float32",
|
| 24 |
+
"transformers_version": "4.18.0.dev0",
|
| 25 |
+
"use_cache": true,
|
| 26 |
+
"vocab_size": 50518
|
| 27 |
+
}
|
pytorch_model-00001-of-00003.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8be47333b91d2908f22cf4a141011b3d4aed8f32e1e8fbd4b186c330847ad159
|
| 3 |
+
size 9956995467
|
pytorch_model-00002-of-00003.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:049bfeb9e4f3f20b5e0afdc96e388a1b7415ba65b7fe74a88a3526cfca4370df
|
| 3 |
+
size 9934797397
|
pytorch_model-00003-of-00003.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:966a867c854fba0c95cbb38ecdeac59ce919c1bbc5f09aaa53084174c1853a8f
|
| 3 |
+
size 7540403219
|
pytorch_model.bin.index.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:179e09c4b2b6e761297b363c8dacc839532d88979448b9ba4f4f6a885033fc60
|
| 3 |
+
size 40879
|