Instructions to use RedHatAI/MiniChat-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-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-3B-pruned50-quant-ds")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/MiniChat-3B-pruned50-quant-ds") model = AutoModelForCausalLM.from_pretrained("RedHatAI/MiniChat-3B-pruned50-quant-ds") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use RedHatAI/MiniChat-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-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-3B-pruned50-quant-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RedHatAI/MiniChat-3B-pruned50-quant-ds
- SGLang
How to use RedHatAI/MiniChat-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-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-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-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-3B-pruned50-quant-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RedHatAI/MiniChat-3B-pruned50-quant-ds with Docker Model Runner:
docker model run hf.co/RedHatAI/MiniChat-3B-pruned50-quant-ds
Commit ·
0484553
1
Parent(s): 68dc6a4
Update README.md
Browse files
README.md
CHANGED
|
@@ -70,7 +70,6 @@ pip install -e "sparseml[transformers]"
|
|
| 70 |
python sparseml/src/sparseml/transformers/sparsification/obcq/obcq.py GeneZC/MiniChat-3B open_platypus --recipe recipe.yaml --save True
|
| 71 |
python sparseml/src/sparseml/transformers/sparsification/obcq/export.py --task text-generation --model_path obcq_deployment
|
| 72 |
cp deployment/model.onnx deployment/model-orig.onnx
|
| 73 |
-
python onnx_kv_inject.py --input-file deployment/model-orig.onnx --output-file deployment/model.onnx
|
| 74 |
```
|
| 75 |
Run this kv-cache injection to speed up the model at inference by caching the Key and Value states:
|
| 76 |
```python
|
|
|
|
| 70 |
python sparseml/src/sparseml/transformers/sparsification/obcq/obcq.py GeneZC/MiniChat-3B open_platypus --recipe recipe.yaml --save True
|
| 71 |
python sparseml/src/sparseml/transformers/sparsification/obcq/export.py --task text-generation --model_path obcq_deployment
|
| 72 |
cp deployment/model.onnx deployment/model-orig.onnx
|
|
|
|
| 73 |
```
|
| 74 |
Run this kv-cache injection to speed up the model at inference by caching the Key and Value states:
|
| 75 |
```python
|