mpt-7B-inference/README.md

40 lines
983 B
Markdown
Raw Normal View History

2023-06-26 05:36:27 +00:00
# MPT 30B inference code using CPU
2023-06-26 05:43:31 +00:00
Run inference on the latest MPT-30B model using your CPU. This inference code uses a [ggml](https://github.com/ggerganov/llama.cpp) quantized model. To run the model we'll use a library called [ctransformers](https://github.com/marella/ctransformers) that has bindings to ggml in python.
I recommend a system with 32GB of ram.
2023-06-26 05:36:27 +00:00
2023-06-26 05:39:46 +00:00
[Inference Demo](https://github.com/abacaj/mpt-30B-inference/assets/7272343/486fc9b1-8216-43cc-93c3-781677235502)
2023-06-26 05:36:27 +00:00
## Requirements
2023-06-26 06:20:33 +00:00
I recommend you use docker for this model, it will make everything easier for you. Tested on AMD Epyc CPU.
2023-06-26 05:36:27 +00:00
## Setup
First create a venv.
```sh
python -m venv env && source env/bin/activate
```
Next install dependencies.
```sh
pip install -r requirements.txt
```
Next download the quantized model weights (about 19GB).
```sh
python download_model.py
```
Ready to rock, run inference.
```sh
python inference.py
```
2023-06-26 05:38:20 +00:00
Next modify inference script prompt and generation parameters.