Skip to content

Commit 6e0ae01

Browse files
committed
convert.py: convert extra print() to named logger
1 parent 39aa1be commit 6e0ae01

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

convert.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ def main(args_in: list[str] | None = None) -> None:
14791479
# Avoid printing anything besides the dump output
14801480
logging.basicConfig(level=logging.CRITICAL)
14811481
else:
1482-
logging.basicConfig(level=logging.INFO)
1482+
logging.basicConfig(level=logger.INFO)
14831483

14841484
if args.no_vocab and args.vocab_only:
14851485
raise ValueError("--vocab-only does not make sense with --no-vocab")
@@ -1520,7 +1520,7 @@ def main(args_in: list[str] | None = None) -> None:
15201520
"q8_0": GGMLFileType.MostlyQ8_0,
15211521
}[args.outtype]
15221522

1523-
logging.info(f"params = {params}")
1523+
logger.info(f"params = {params}")
15241524

15251525
model_parent_path = model_plus.paths[0].parent
15261526
vocab_path = Path(args.vocab_dir or args.model or model_parent_path)
@@ -1535,26 +1535,26 @@ def main(args_in: list[str] | None = None) -> None:
15351535
outfile = args.outfile
15361536
OutputFile.write_vocab_only(outfile, params, vocab, special_vocab,
15371537
endianess=endianess, pad_vocab=args.pad_vocab)
1538-
logging.info(f"Wrote {outfile}")
1538+
logger.info(f"Wrote {outfile}")
15391539
return
15401540

15411541
if model_plus.vocab is not None and args.vocab_dir is None and not args.no_vocab:
15421542
vocab = model_plus.vocab
15431543

1544-
logging.info(f"Vocab info: {vocab}")
1545-
logging.info(f"Special vocab info: {special_vocab}")
1544+
logger.info(f"Vocab info: {vocab}")
1545+
logger.info(f"Special vocab info: {special_vocab}")
15461546
model = model_plus.model
15471547
model = convert_model_names(model, params, args.skip_unknown)
15481548
ftype = pick_output_type(model, args.outtype)
15491549
model = convert_to_output_type(model, ftype)
15501550
outfile = args.outfile or default_outfile(model_plus.paths, ftype)
15511551

15521552
params.ftype = ftype
1553-
logging.info(f"Writing {outfile}, format {ftype}")
1553+
logger.info(f"Writing {outfile}, format {ftype}")
15541554

15551555
OutputFile.write_all(outfile, ftype, params, model, vocab, special_vocab,
15561556
concurrency=args.concurrency, endianess=endianess, pad_vocab=args.pad_vocab)
1557-
logging.info(f"Wrote {outfile}")
1557+
logger.info(f"Wrote {outfile}")
15581558

15591559

15601560
if __name__ == '__main__':

0 commit comments

Comments
 (0)