Text Generation
Transformers
Safetensors
step3p5
quantized
abliterated
uncensored
Mixture of Experts
conversational
custom_code
Instructions to use Kilinskiy/Step-3.5-Flash-Ablitirated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kilinskiy/Step-3.5-Flash-Ablitirated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kilinskiy/Step-3.5-Flash-Ablitirated", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kilinskiy/Step-3.5-Flash-Ablitirated", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Kilinskiy/Step-3.5-Flash-Ablitirated", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kilinskiy/Step-3.5-Flash-Ablitirated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kilinskiy/Step-3.5-Flash-Ablitirated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kilinskiy/Step-3.5-Flash-Ablitirated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kilinskiy/Step-3.5-Flash-Ablitirated
- SGLang
How to use Kilinskiy/Step-3.5-Flash-Ablitirated 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 "Kilinskiy/Step-3.5-Flash-Ablitirated" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kilinskiy/Step-3.5-Flash-Ablitirated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Kilinskiy/Step-3.5-Flash-Ablitirated" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kilinskiy/Step-3.5-Flash-Ablitirated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kilinskiy/Step-3.5-Flash-Ablitirated with Docker Model Runner:
docker model run hf.co/Kilinskiy/Step-3.5-Flash-Ablitirated
Upload configuration_step3p5.py
Browse files- configuration_step3p5.py +59 -0
configuration_step3p5.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, Optional, Union
|
| 2 |
+
|
| 3 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class Step3p5Config(PretrainedConfig):
|
| 8 |
+
model_type = "step3p5"
|
| 9 |
+
architectures = ["Step3p5ForCausalLM"]
|
| 10 |
+
|
| 11 |
+
def __init__(
|
| 12 |
+
self,
|
| 13 |
+
hidden_size: int = 4096,
|
| 14 |
+
intermediate_size: int = 11264,
|
| 15 |
+
num_attention_heads: int = 64,
|
| 16 |
+
num_attention_groups: int = 8,
|
| 17 |
+
num_hidden_layers: int = 45,
|
| 18 |
+
max_seq_len: int = 128000,
|
| 19 |
+
vocab_size: int = 128815,
|
| 20 |
+
rms_norm_eps: float = 1e-5,
|
| 21 |
+
moe_intermediate_size: int = 1280,
|
| 22 |
+
moe_num_experts: int = 288,
|
| 23 |
+
moe_top_k: int = 8,
|
| 24 |
+
rope_theta: float = 10000,
|
| 25 |
+
rope_scaling: Optional[dict[str, Any]] = None,
|
| 26 |
+
max_position_embeddings: int = 128000,
|
| 27 |
+
share_expert_dims: int = 1280,
|
| 28 |
+
head_dim: int = 128,
|
| 29 |
+
norm_expert_weight: bool = True,
|
| 30 |
+
layer_types: list[str] = None,
|
| 31 |
+
sliding_window: Optional[int] = None,
|
| 32 |
+
moe_layers_enum: tuple[int] = (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
| 33 |
+
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
| 34 |
+
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
| 35 |
+
35, 36, 37, 38, 39, 40, 41, 42, 43, 44),
|
| 36 |
+
**kwargs,
|
| 37 |
+
) -> None:
|
| 38 |
+
self.hidden_size = hidden_size
|
| 39 |
+
self.intermediate_size = intermediate_size
|
| 40 |
+
self.num_attention_heads = num_attention_heads
|
| 41 |
+
self.num_attention_groups = num_attention_groups
|
| 42 |
+
self.num_hidden_layers = num_hidden_layers
|
| 43 |
+
self.max_seq_len = max_seq_len
|
| 44 |
+
self.vocab_size = vocab_size
|
| 45 |
+
self.rms_norm_eps = rms_norm_eps
|
| 46 |
+
self.moe_intermediate_size = moe_intermediate_size
|
| 47 |
+
self.moe_num_experts = moe_num_experts
|
| 48 |
+
self.moe_top_k = moe_top_k
|
| 49 |
+
self.rope_theta = rope_theta
|
| 50 |
+
self.rope_scaling = rope_scaling
|
| 51 |
+
self.max_position_embeddings = max_position_embeddings
|
| 52 |
+
self.share_expert_dim = share_expert_dims
|
| 53 |
+
self.head_dim = head_dim
|
| 54 |
+
self.norm_expert_weight = norm_expert_weight
|
| 55 |
+
self.moe_layers_enum = moe_layers_enum
|
| 56 |
+
self.layer_types = layer_types
|
| 57 |
+
self.sliding_window = sliding_window
|
| 58 |
+
super().__init__(**kwargs)
|
| 59 |
+
|