Run inference on MPT-7B using CPU
Find a file
Anton Bacaj a4eab07cc0 readme
2023-06-26 07:12:21 +00:00
media initial commit 2023-06-26 05:36:27 +00:00
.gitignore Initial commit 2023-06-26 01:30:01 -04:00
download_model.py cleanup code 2023-06-26 07:10:40 +00:00
inference.py cleanup code 2023-06-26 07:10:40 +00:00
LICENSE Initial commit 2023-06-26 01:30:01 -04:00
README.md readme 2023-06-26 07:12:21 +00:00
requirements.txt initial commit 2023-06-26 05:36:27 +00:00

MPT 30B inference code using CPU

Run inference on the latest MPT-30B model using your CPU. This inference code uses a ggml quantized model. To run the model we'll use a library called ctransformers that has bindings to ggml in python.

Inference Demo

Requirements

I recommend you use docker for this model, it will make everything easier for you. Minimum specs system with 32GB of ram otherwise limit the context_length of model. Tested on AMD Epyc CPU, Python 3.10.

Setup

First create a venv.

python -m venv env && source env/bin/activate

Next install dependencies.

pip install -r requirements.txt

Next download the quantized model weights (about 19GB).

python download_model.py

Ready to rock, run inference.

python inference.py

Next modify inference script prompt and generation parameters.