Text Generation
Transformers
PyTorch
code
gpt_neox
causal-lm
Eval Results (legacy)
text-generation-inference
Instructions to use stabilityai/stablecode-completion-alpha-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stabilityai/stablecode-completion-alpha-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stabilityai/stablecode-completion-alpha-3b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablecode-completion-alpha-3b") model = AutoModelForCausalLM.from_pretrained("stabilityai/stablecode-completion-alpha-3b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stabilityai/stablecode-completion-alpha-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stabilityai/stablecode-completion-alpha-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stabilityai/stablecode-completion-alpha-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stabilityai/stablecode-completion-alpha-3b
- SGLang
How to use stabilityai/stablecode-completion-alpha-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 "stabilityai/stablecode-completion-alpha-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": "stabilityai/stablecode-completion-alpha-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 "stabilityai/stablecode-completion-alpha-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": "stabilityai/stablecode-completion-alpha-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stabilityai/stablecode-completion-alpha-3b with Docker Model Runner:
docker model run hf.co/stabilityai/stablecode-completion-alpha-3b
Commit ·
e9af0ee
1
Parent(s): b2ce6ac
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,7 +11,9 @@ license: cc-by-sa-4.0
|
|
| 11 |
|
| 12 |
## Model Description
|
| 13 |
|
| 14 |
-
`StableCode-Completion-Alpha-3B` is a 3 billion parameter decoder-only code completion model pre-trained on diverse set of programming languages that topped the stackoverflow developer survey.
|
|
|
|
|
|
|
| 15 |
The model is intended to do single/multiline code completion from a long context window upto 16k tokens.
|
| 16 |
Get started generating code with `StableCode-Completion-Alpha-3B` by using the following code snippet:
|
| 17 |
|
|
@@ -38,7 +40,7 @@ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
|
|
| 38 |
|
| 39 |
* **Developed by**: Code.AI Team @ [Stability AI](https://stability.ai/)
|
| 40 |
* **Model type**: `StableCode-Completion-Alpha-3B` models are auto-regressive language models based on the transformer decoder architecture.
|
| 41 |
-
* **Language(s)**:
|
| 42 |
* **Library**: [GPT-NeoX](https://github.com/EleutherAI/gpt-neox)
|
| 43 |
* **License**: Model checkpoints are licensed under the Creative Commons license ([CC BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/)). Under this license, you must give [credit](https://creativecommons.org/licenses/by/4.0/#) to Stability AI, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by/4.0/#). You may do so in any reasonable manner, but not in any way that suggests the Stability AI endorses you or your use.
|
| 44 |
* **Contact**: For questions and comments about the model, please email `lm@stability.ai`
|
|
@@ -60,7 +62,7 @@ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
|
|
| 60 |
|
| 61 |
### Training Dataset
|
| 62 |
|
| 63 |
-
The first pre-training stage relies on 300B tokens sourced from various top programming languages occuring in the stackoverflow developer survey. We then finetune it on a longer context augmentation of `starcoder-data.
|
| 64 |
|
| 65 |
### Training Procedure
|
| 66 |
|
|
|
|
| 11 |
|
| 12 |
## Model Description
|
| 13 |
|
| 14 |
+
`StableCode-Completion-Alpha-3B` is a 3 billion parameter decoder-only code completion model pre-trained on diverse set of programming languages that topped the stackoverflow developer survey.
|
| 15 |
+
|
| 16 |
+
## Usage
|
| 17 |
The model is intended to do single/multiline code completion from a long context window upto 16k tokens.
|
| 18 |
Get started generating code with `StableCode-Completion-Alpha-3B` by using the following code snippet:
|
| 19 |
|
|
|
|
| 40 |
|
| 41 |
* **Developed by**: Code.AI Team @ [Stability AI](https://stability.ai/)
|
| 42 |
* **Model type**: `StableCode-Completion-Alpha-3B` models are auto-regressive language models based on the transformer decoder architecture.
|
| 43 |
+
* **Language(s)**: Code
|
| 44 |
* **Library**: [GPT-NeoX](https://github.com/EleutherAI/gpt-neox)
|
| 45 |
* **License**: Model checkpoints are licensed under the Creative Commons license ([CC BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/)). Under this license, you must give [credit](https://creativecommons.org/licenses/by/4.0/#) to Stability AI, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by/4.0/#). You may do so in any reasonable manner, but not in any way that suggests the Stability AI endorses you or your use.
|
| 46 |
* **Contact**: For questions and comments about the model, please email `lm@stability.ai`
|
|
|
|
| 62 |
|
| 63 |
### Training Dataset
|
| 64 |
|
| 65 |
+
The first pre-training stage relies on 300B tokens sourced from various top programming languages occuring in the stackoverflow developer survey in the `starcoder-data` dataset. We then finetune it on a longer context augmentation of `starcoder-data` dataset.
|
| 66 |
|
| 67 |
### Training Procedure
|
| 68 |
|