Instructions to use RedHatAI/mpt-7b-gsm8k-pt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/mpt-7b-gsm8k-pt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/mpt-7b-gsm8k-pt", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/mpt-7b-gsm8k-pt", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("RedHatAI/mpt-7b-gsm8k-pt", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use RedHatAI/mpt-7b-gsm8k-pt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/mpt-7b-gsm8k-pt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/mpt-7b-gsm8k-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RedHatAI/mpt-7b-gsm8k-pt
- SGLang
How to use RedHatAI/mpt-7b-gsm8k-pt 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/mpt-7b-gsm8k-pt" \ --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/mpt-7b-gsm8k-pt", "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/mpt-7b-gsm8k-pt" \ --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/mpt-7b-gsm8k-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RedHatAI/mpt-7b-gsm8k-pt with Docker Model Runner:
docker model run hf.co/RedHatAI/mpt-7b-gsm8k-pt
mpt-7b-gsm8k
Paper: Sparse Finetuning for Inference Acceleration of Large Language Models
Code: https://github.com/neuralmagic/deepsparse/tree/main/research/mpt
This model was produced from a MPT-7B base model finetuned on the GSM8k dataset for 2 epochs and contains the original PyTorch weights.
GSM8k zero-shot accuracy with lm-evaluation-harness : 28.2%
All MPT model weights are available on SparseZoo and CPU speedup for generative inference can be reproduced by following the instructions at DeepSparse
| Model Links | Compression |
|---|---|
| neuralmagic/mpt-7b-gsm8k-quant | Quantization (W8A8) |
| neuralmagic/mpt-7b-gsm8k-pruned40-quant | Quantization (W8A8) & 40% Pruning |
| neuralmagic/mpt-7b-gsm8k-pruned50-quant | Quantization (W8A8) & 50% Pruning |
| neuralmagic/mpt-7b-gsm8k-pruned60-quant | Quantization (W8A8) & 60% Pruning |
| neuralmagic/mpt-7b-gsm8k-pruned70-quant | Quantization (W8A8) & 70% Pruning |
| neuralmagic/mpt-7b-gsm8k-pruned70-quant | Quantization (W8A8) & 75% Pruning |
| neuralmagic/mpt-7b-gsm8k-pruned80-quant | Quantization (W8A8) & 80% Pruning |
For general questions on these models and sparsification methods, reach out to the engineering team on our community Slack.
- Downloads last month
- 22