Instructions to use StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072
- SGLang
How to use StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072 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 "StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072" \ --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": "StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072", "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 "StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072" \ --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": "StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072 with Docker Model Runner:
docker model run hf.co/StepLaw/StepLaw-N_59M-D_7.0B-LR7.812e-03-BS131072
Jack Li commited on
Upload configuration_step1.py with huggingface_hub
Browse files- configuration_step1.py +41 -0
configuration_step1.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Optional, List, Any, Dict
|
| 2 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class Step1Config(PretrainedConfig):
|
| 7 |
+
model_type = "step1"
|
| 8 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 9 |
+
|
| 10 |
+
def __init__(
|
| 11 |
+
self,
|
| 12 |
+
hidden_size: int = 5120,
|
| 13 |
+
intermediate_size: int = 13312,
|
| 14 |
+
num_attention_heads: int = 40,
|
| 15 |
+
num_attention_groups: int = 8,
|
| 16 |
+
num_hidden_layers: int = 48,
|
| 17 |
+
max_seq_len: int = 4096,
|
| 18 |
+
vocab_size: int = 65536,
|
| 19 |
+
rms_norm_eps: float = 1e-5,
|
| 20 |
+
bos_token_id: int = 1,
|
| 21 |
+
eos_token_id: int = 3,
|
| 22 |
+
pad_token_id: int = 0,
|
| 23 |
+
**kwargs,
|
| 24 |
+
) -> None:
|
| 25 |
+
self.hidden_size = hidden_size
|
| 26 |
+
self.intermediate_size = intermediate_size
|
| 27 |
+
self.num_attention_heads = num_attention_heads
|
| 28 |
+
self.num_attention_groups = num_attention_groups
|
| 29 |
+
self.num_hidden_layers = num_hidden_layers
|
| 30 |
+
self.max_seq_len = max_seq_len
|
| 31 |
+
self.vocab_size = vocab_size
|
| 32 |
+
self.rms_norm_eps = rms_norm_eps
|
| 33 |
+
super().__init__(
|
| 34 |
+
bos_token_id=bos_token_id,
|
| 35 |
+
pad_token_id=pad_token_id,
|
| 36 |
+
eos_token_id=eos_token_id,
|
| 37 |
+
**kwargs
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
__all__ = ["Step1Config"]
|