Instructions to use RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds") model = AutoModelForCausalLM.from_pretrained("RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds
- SGLang
How to use RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds 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 "RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds" \ --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": "RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds", "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 "RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds" \ --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": "RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds with Docker Model Runner:
docker model run hf.co/RedHatAI/MiniChat-1.5-3B-pruned50-quant-ds
Commit ·
df82913
1
Parent(s): b28eb0a
Create recipe.yaml
Browse files- recipe.yaml +37 -0
recipe.yaml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
test_stage:
|
| 2 |
+
obcq_modifiers:
|
| 3 |
+
SmoothQuantModifier:
|
| 4 |
+
smoothing_strength: 0.8
|
| 5 |
+
mappings: [
|
| 6 |
+
[["re:.*q_proj", "re:.*k_proj", "re:.*v_proj"], "re:.*input_layernorm"],
|
| 7 |
+
[["re:.*gate_proj", "re:.*up_proj"], "re:.*post_attention_layernorm"]
|
| 8 |
+
]
|
| 9 |
+
QuantizationModifier:
|
| 10 |
+
ignore:
|
| 11 |
+
# These operations don't make sense to quantize
|
| 12 |
+
- LlamaRotaryEmbedding
|
| 13 |
+
- LlamaRMSNorm
|
| 14 |
+
- SiLUActivation
|
| 15 |
+
# Skip quantizing the BMMs
|
| 16 |
+
- QuantizableMatMul
|
| 17 |
+
# Skip quantizing the layers with the most sensitive activations
|
| 18 |
+
- model.layers.21.mlp.down_proj
|
| 19 |
+
- model.layers.7.mlp.down_proj
|
| 20 |
+
- model.layers.2.mlp.down_proj
|
| 21 |
+
- model.layers.20.mlp.down_proj
|
| 22 |
+
- model.layers.19.mlp.down_proj
|
| 23 |
+
post_oneshot_calibration: true
|
| 24 |
+
scheme_overrides:
|
| 25 |
+
Embedding:
|
| 26 |
+
input_activations: null
|
| 27 |
+
weights:
|
| 28 |
+
num_bits: 8
|
| 29 |
+
symmetric: false
|
| 30 |
+
SparseGPTModifier:
|
| 31 |
+
sparsity: 0.5
|
| 32 |
+
block_size: 128
|
| 33 |
+
sequential_update: true
|
| 34 |
+
quantize: true
|
| 35 |
+
percdamp: 0.01
|
| 36 |
+
mask_structure: "0:0"
|
| 37 |
+
targets: ["re:model.layers.\\d*$"]
|