Instructions to use stabilityai/tiny-random-stablelm-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stabilityai/tiny-random-stablelm-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stabilityai/tiny-random-stablelm-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stabilityai/tiny-random-stablelm-2") model = AutoModelForCausalLM.from_pretrained("stabilityai/tiny-random-stablelm-2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use stabilityai/tiny-random-stablelm-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stabilityai/tiny-random-stablelm-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stabilityai/tiny-random-stablelm-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stabilityai/tiny-random-stablelm-2
- SGLang
How to use stabilityai/tiny-random-stablelm-2 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/tiny-random-stablelm-2" \ --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/tiny-random-stablelm-2", "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/tiny-random-stablelm-2" \ --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/tiny-random-stablelm-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stabilityai/tiny-random-stablelm-2 with Docker Model Runner:
docker model run hf.co/stabilityai/tiny-random-stablelm-2
update(weights): train rand init model for 5k steps on cosmopedia
Browse files- config.json +11 -8
- generation_config.json +2 -2
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -1,30 +1,33 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"StableLmForCausalLM"
|
| 4 |
],
|
| 5 |
"attention_dropout": 0.0,
|
| 6 |
-
"bos_token_id":
|
| 7 |
-
"eos_token_id":
|
| 8 |
"hidden_act": "silu",
|
| 9 |
"hidden_dropout": 0.0,
|
| 10 |
"hidden_size": 512,
|
| 11 |
-
"initializer_range": 0.
|
| 12 |
-
"intermediate_size":
|
| 13 |
"layer_norm_eps": 1e-05,
|
| 14 |
"max_position_embeddings": 4096,
|
| 15 |
"model_type": "stablelm",
|
| 16 |
"num_attention_heads": 16,
|
| 17 |
-
"num_hidden_layers":
|
| 18 |
-
"num_key_value_heads":
|
| 19 |
"partial_rotary_factor": 0.25,
|
| 20 |
"qk_layernorm": true,
|
| 21 |
"rope_scaling": null,
|
| 22 |
"rope_theta": 10000,
|
|
|
|
| 23 |
"tie_word_embeddings": false,
|
| 24 |
-
"torch_dtype": "
|
| 25 |
"transformers_version": "4.39.0.dev0",
|
| 26 |
"use_cache": true,
|
|
|
|
| 27 |
"use_parallel_residual": true,
|
| 28 |
"use_qkv_bias": false,
|
| 29 |
-
"vocab_size":
|
| 30 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/weka2/home-guac/stable-lm/stable-neox/ckpts/stablelm_2_tiny/global_step6000",
|
| 3 |
"architectures": [
|
| 4 |
"StableLmForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 100257,
|
| 8 |
+
"eos_token_id": 100257,
|
| 9 |
"hidden_act": "silu",
|
| 10 |
"hidden_dropout": 0.0,
|
| 11 |
"hidden_size": 512,
|
| 12 |
+
"initializer_range": 0.01,
|
| 13 |
+
"intermediate_size": 1536,
|
| 14 |
"layer_norm_eps": 1e-05,
|
| 15 |
"max_position_embeddings": 4096,
|
| 16 |
"model_type": "stablelm",
|
| 17 |
"num_attention_heads": 16,
|
| 18 |
+
"num_hidden_layers": 8,
|
| 19 |
+
"num_key_value_heads": 4,
|
| 20 |
"partial_rotary_factor": 0.25,
|
| 21 |
"qk_layernorm": true,
|
| 22 |
"rope_scaling": null,
|
| 23 |
"rope_theta": 10000,
|
| 24 |
+
"rotary_scaling_factor": 1.0,
|
| 25 |
"tie_word_embeddings": false,
|
| 26 |
+
"torch_dtype": "bfloat16",
|
| 27 |
"transformers_version": "4.39.0.dev0",
|
| 28 |
"use_cache": true,
|
| 29 |
+
"use_norm_bias": false,
|
| 30 |
"use_parallel_residual": true,
|
| 31 |
"use_qkv_bias": false,
|
| 32 |
+
"vocab_size": 100352
|
| 33 |
}
|
generation_config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"bos_token_id":
|
| 4 |
-
"eos_token_id":
|
| 5 |
"transformers_version": "4.39.0.dev0"
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 100257,
|
| 4 |
+
"eos_token_id": 100257,
|
| 5 |
"transformers_version": "4.39.0.dev0"
|
| 6 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5d04033878a589c26fea21e661a7f251d493790ac6bd595ad16a5834e6b17b5f
|
| 3 |
+
size 253811856
|