Instructions to use Azrail/smallm_350 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azrail/smallm_350 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Azrail/smallm_350", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Azrail/smallm_350", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Azrail/smallm_350 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Azrail/smallm_350" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azrail/smallm_350", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Azrail/smallm_350
- SGLang
How to use Azrail/smallm_350 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 "Azrail/smallm_350" \ --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": "Azrail/smallm_350", "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 "Azrail/smallm_350" \ --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": "Azrail/smallm_350", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Azrail/smallm_350 with Docker Model Runner:
docker model run hf.co/Azrail/smallm_350
Upload SmalLmForCausalLM
Browse files- config.json +5 -1
config.json
CHANGED
|
@@ -4,6 +4,10 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.1,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"balancing_coef": 0.0001,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"embedding_dropout": 0.0,
|
|
@@ -38,7 +42,7 @@
|
|
| 38 |
"sliding_window_attention": true,
|
| 39 |
"sliding_window_context": 1024,
|
| 40 |
"sliding_window_period": 4,
|
| 41 |
-
"static_residual":
|
| 42 |
"token_experts": 3,
|
| 43 |
"torch_dtype": "float32",
|
| 44 |
"transformers_version": "4.50.3",
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.1,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "config.SmalLmConfig",
|
| 9 |
+
"AutoModelForCausalLM": "model.SmalLmForCausalLM"
|
| 10 |
+
},
|
| 11 |
"balancing_coef": 0.0001,
|
| 12 |
"bos_token_id": 1,
|
| 13 |
"embedding_dropout": 0.0,
|
|
|
|
| 42 |
"sliding_window_attention": true,
|
| 43 |
"sliding_window_context": 1024,
|
| 44 |
"sliding_window_period": 4,
|
| 45 |
+
"static_residual": true,
|
| 46 |
"token_experts": 3,
|
| 47 |
"torch_dtype": "float32",
|
| 48 |
"transformers_version": "4.50.3",
|