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")# pip install -U transformers accelerate # 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 History
-
update: redirect users to more recent models
Jonathan Tow1d43a3b
-
Update README.md (#1)
- Update README.md (8ab654a201ea2beefc6916c7c1b63caa5c0c6be9) Co-authored-by: mkshing <mkshing@users.noreply.huggingface.co>3836635
-
Update README.md
1ef4c00 -
Update README.md
785a6e9 -
Update README.md
d108e44 -
Update README.md
5d3723b -
Update README.md
fd8d746 -
Update README.md
780d6d4 -
Update README.md
007331f -
Update README.md
99be347 -
Update README.md
83e3e96 -
Update README.md
223c0c5 -
Upload tokenizer
f685de0
-
Update README.md
d247320 -
Update README.md
bb98e09 -
Upload GPTNeoXForCausalLM
714a3dd -
Delete generation_config.json
7ccbe41 -
Delete config.json
59e19a0 -
Delete pytorch_model.bin.index.json
356d0ce -
Delete pytorch_model-00002-of-00002.bin
fbcb1b0 -
Delete pytorch_model-00001-of-00002.bin
08bf6b2 -
Upload GPTNeoXForCausalLM
59ac43e -
Update README.md
770b64b -
Update README.md
8e5c139 -
Create README.md
aa47087 -
initial commit
7c2ad08