Instructions to use stabilityai/stablelm-base-alpha-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stabilityai/stablelm-base-alpha-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stabilityai/stablelm-base-alpha-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-base-alpha-7b") model = AutoModelForCausalLM.from_pretrained("stabilityai/stablelm-base-alpha-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stabilityai/stablelm-base-alpha-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stabilityai/stablelm-base-alpha-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stabilityai/stablelm-base-alpha-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stabilityai/stablelm-base-alpha-7b
- SGLang
How to use stabilityai/stablelm-base-alpha-7b 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/stablelm-base-alpha-7b" \ --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/stablelm-base-alpha-7b", "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/stablelm-base-alpha-7b" \ --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/stablelm-base-alpha-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stabilityai/stablelm-base-alpha-7b with Docker Model Runner:
docker model run hf.co/stabilityai/stablelm-base-alpha-7b
Commit ·
5d3723b
1
Parent(s): fd8d746
Update README.md
Browse files
README.md
CHANGED
|
@@ -55,7 +55,7 @@ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
|
|
| 55 |
|
| 56 |
### Training Procedure
|
| 57 |
|
| 58 |
-
Models are pre-trained on the aforementioned dataset in mixed-precision (FP16), optimized with Adam, and trained using the NeoX tokenizer with a vocabulary size of 50,257. We outline the complete hyperparameters choices in the project's GitHub repository
|
| 59 |
|
| 60 |
## Use and Limitations
|
| 61 |
|
|
@@ -65,7 +65,7 @@ These models are intended to be used by all individuals as foundational models f
|
|
| 65 |
|
| 66 |
### Limitations and bias
|
| 67 |
|
| 68 |
-
The pre-training dataset may
|
| 69 |
|
| 70 |
## Citations
|
| 71 |
|
|
|
|
| 55 |
|
| 56 |
### Training Procedure
|
| 57 |
|
| 58 |
+
Models are pre-trained on the aforementioned dataset in mixed-precision (FP16), optimized with Adam, and trained using the NeoX tokenizer with a vocabulary size of 50,257. We outline the complete hyperparameters choices in the project's [GitHub repository](https://github.com/Stability-AI/StableLM-staging/blob/main/configs/stablelm-base-alpha-7b.yaml).
|
| 59 |
|
| 60 |
## Use and Limitations
|
| 61 |
|
|
|
|
| 65 |
|
| 66 |
### Limitations and bias
|
| 67 |
|
| 68 |
+
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 users exercise reasonable 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.
|
| 69 |
|
| 70 |
## Citations
|
| 71 |
|