Skip to content

Commit 4ad7313

Browse files
authored
add 4_0 to default outfile namestr dict (#1031)
this came up when trying to convert the gpt4all-lora-unfiltered-quantized.bin file
1 parent 315a95a commit 4ad7313

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ def default_outfile(model_paths: List[Path], params: Params) -> Path:
10851085
namestr = {
10861086
GGMLFileType.AllF32: "f32",
10871087
GGMLFileType.MostlyF16: "f16",
1088+
GGMLFileType.MostlyQ4_0: "q4_0",
10881089
GGMLFileType.MostlyQ4_1: "q4_1",
10891090
GGMLFileType.PerLayerIsQ4_1: "q4_1",
10901091
}[params.file_type]
@@ -1108,7 +1109,7 @@ def main(args_in: Optional[List[str]] = None) -> None:
11081109
parser.add_argument("--dump", action="store_true", help="don't convert, just show what's in the model")
11091110
parser.add_argument("--dump-single", action="store_true", help="don't convert, just show what's in a single model file")
11101111
parser.add_argument("--vocab-only", action="store_true", help="extract only the vocab")
1111-
parser.add_argument("--outtype", choices=["f32", "f16", "q4_1"], help="output format (default: based on input)")
1112+
parser.add_argument("--outtype", choices=["f32", "f16", "q4_1", "q4_0"], help="output format (default: based on input)")
11121113
parser.add_argument("--vocab-dir", type=Path, help="directory containing tokenizer.model, if separate from model file")
11131114
parser.add_argument("--outfile", type=Path, help="path to write to; default: based on input")
11141115
parser.add_argument("model", type=Path, help="directory containing model file, or model file itself (*.pth, *.pt, *.bin)")

0 commit comments

Comments
 (0)