Skip to content

Commit 8c132f4

Browse files
committed
*.py: refactor logging.basicConfig()
1 parent e6b9e8b commit 8c132f4

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

convert-llama-ggml-to-gguf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,7 @@ def handle_args():
407407

408408
def main():
409409
cfg = handle_args()
410-
if cfg.verbose:
411-
logging.basicConfig(level=logging.DEBUG)
412-
else:
413-
logging.basicConfig(level=logging.INFO)
410+
logging.basicConfig(level=logging.DEBUG if cfg.verbose else logging.INFO)
414411
logger.info(f'* Using config: {cfg}')
415412
logger.warning('=== WARNING === Be aware that this conversion script is best-effort. Use a native GGUF model if possible. === WARNING ===')
416413
if cfg.model_metadata_dir is None and (cfg.gqa == 1 or cfg.eps == '5.0e-06'):

scripts/run-with-preset.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@
6767
parser.print_help()
6868
sys.exit(0)
6969

70-
if known_args.verbose:
71-
logging.basicConfig(level=logging.DEBUG)
72-
else:
73-
logging.basicConfig(level=logging.INFO)
70+
logging.basicConfig(level=logging.DEBUG if known_args.verbose else logging.INFO)
7471

7572
props = dict()
7673

0 commit comments

Comments
 (0)