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") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,7 +11,7 @@ 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
|
| 15 |
|
| 16 |
## Usage
|
| 17 |
The model is intended to do single/multiline code completion from a long context window upto 16k tokens.
|
|
@@ -21,7 +21,7 @@ Get started generating code with `StableCode-Completion-Alpha-3B` by using the f
|
|
| 21 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablecode-completion-alpha-3b")
|
| 23 |
model = AutoModelForCausalLM.from_pretrained(
|
| 24 |
-
"stabilityai/
|
| 25 |
trust_remote_code=True,
|
| 26 |
torch_dtype="auto",
|
| 27 |
)
|
|
@@ -74,6 +74,8 @@ The model is pre-trained on the dataset mixes mentioned above in mixed-precision
|
|
| 74 |
|
| 75 |
### Intended Use
|
| 76 |
|
|
|
|
| 77 |
|
| 78 |
### Limitations and bias
|
| 79 |
|
|
|
|
|
|
| 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 were the top used languages based on the 2023 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.
|
|
|
|
| 21 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablecode-completion-alpha-3b")
|
| 23 |
model = AutoModelForCausalLM.from_pretrained(
|
| 24 |
+
"stabilityai/stablecode-completion-alpha-3b",
|
| 25 |
trust_remote_code=True,
|
| 26 |
torch_dtype="auto",
|
| 27 |
)
|
|
|
|
| 74 |
|
| 75 |
### Intended Use
|
| 76 |
|
| 77 |
+
These models are intended to be used by developers and researchers as foundational models for application-specific fine-tuning.
|
| 78 |
|
| 79 |
### Limitations and bias
|
| 80 |
|
| 81 |
+
The pre-training dataset may have contained offensive or inappropriate content even after applying data cleansing filters which can be reflected in the model-generated text. We recommend that users exercise caution when using these models in production systems. Do not use the models for any applications that may cause harm or distress to individuals or groups.
|