Files
llama.cpp/convert-pth-to-ggml.py
T

11 lines
474 B
Python
Raw Normal View History

2023-04-14 00:03:03 -07:00
# Compatibility stub
2023-03-21 17:29:41 +02:00
import argparse
2023-03-21 17:29:41 +02:00
2023-04-14 00:03:03 -07:00
import convert
2023-03-10 20:40:58 +02:00
2023-04-14 00:03:03 -07:00
parser = argparse.ArgumentParser(description='Convert a LLaMA model checkpoint to a ggml compatible file')
parser.add_argument('dir_model', help='directory containing the model checkpoint')
parser.add_argument('ftype', help='file type (0: float32, 1: float16)', type=int, choices=[0, 1], default=1)
args = parser.parse_args()
convert.main(['--outtype', 'f16' if args.ftype == 1 else 'f32', '--', args.dir_model])