Skip to content

Convert Model

You can download models from here, or you can convert a PyTorch/SafeTensor model to an mllm model yourself.

To start the conversion process, you need to have Python (3.8+) installed and install the required packages.

Terminal window
cd tools/convertor
pip install -r ./requirements.txt

Convert a single-file PyTorch model

You can convert a single file’s PyTorch model following the instructions below.

Terminal window
python convert.py --input_model=model.pth --output_model=model.mllm --type=torch

Convert a multi-file PyTorch model

You can convert a multi-file PyTorch model using the instructions below.

Terminal window
python convert.py --input_model=pytorch_model.bin.index.json --output_model=model.mllm --type=torch

Convert a single-file SafeTensor model

You can convert a single file’s SafeTensor model with the following instructions.

Terminal window
python convert.py --input_model=model.safetensors --output_model=model.mllm --type=safetensor

Convert a multi-file SafeTensor model

You can download models from Hugging Face and convert a multi-file SafeTensor model using the instructions below.

Terminal window
python convert.py --input_model=model.safetensors.index.json --output_model=model.mllm --type=safetensor