thiswillbeyourgithub Claude Opus 4.8 commited on
Commit
83ec1af
·
1 Parent(s): fa7c830

quantize-int8-smoothquant: use one fixed append-mode log file

Browse files

Replace the per-run timestamped log filename with a single fixed
./quantize-int8-smoothquant.log opened in append mode, so successive runs
accumulate in one file. Drops the now-unused datetime import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

scripts/quantize-int8-smoothquant.py CHANGED
@@ -86,7 +86,6 @@ import shutil
86
  import subprocess
87
  import sys
88
  import time
89
- from datetime import datetime
90
  from pathlib import Path
91
 
92
  import numpy as np
@@ -116,6 +115,7 @@ def configure_logging(log_file):
116
  str(log_file),
117
  level="DEBUG",
118
  format="{time:YYYY-MM-DD HH:mm:ss} | {level: <7} | {message}",
 
119
  enqueue=True,
120
  )
121
  logger.info(f"[sq] logging to {log_file}")
@@ -391,13 +391,12 @@ def main():
391
  "measured ~0.96 cosine yet tracked fp16 WER (10.9%% vs 10.2%%), so the "
392
  "floor sits well below that. A true collapse lands far lower.")
393
  ap.add_argument("--ffmpeg", default=None, help="ffmpeg binary (else $FFMPEG / PATH)")
394
- ap.add_argument("--log-file", default=None,
395
- help="path for the run log file (logs always also go to stderr). "
396
- "Default: ./quantize-int8-smoothquant-<timestamp>.log")
397
  args = ap.parse_args()
398
 
399
- log_file = args.log_file or f"quantize-int8-smoothquant-{datetime.now():%Y%m%d-%H%M%S}.log"
400
- configure_logging(log_file)
401
 
402
  model_dir = Path(args.model_dir)
403
  in_encoder = model_dir / "encoder-model.onnx"
 
86
  import subprocess
87
  import sys
88
  import time
 
89
  from pathlib import Path
90
 
91
  import numpy as np
 
115
  str(log_file),
116
  level="DEBUG",
117
  format="{time:YYYY-MM-DD HH:mm:ss} | {level: <7} | {message}",
118
+ mode="a", # append: one fixed file accumulates every run
119
  enqueue=True,
120
  )
121
  logger.info(f"[sq] logging to {log_file}")
 
391
  "measured ~0.96 cosine yet tracked fp16 WER (10.9%% vs 10.2%%), so the "
392
  "floor sits well below that. A true collapse lands far lower.")
393
  ap.add_argument("--ffmpeg", default=None, help="ffmpeg binary (else $FFMPEG / PATH)")
394
+ ap.add_argument("--log-file", default="quantize-int8-smoothquant.log",
395
+ help="path for the run log file, appended to across runs (logs always "
396
+ "also go to stderr). Default: ./quantize-int8-smoothquant.log")
397
  args = ap.parse_args()
398
 
399
+ configure_logging(args.log_file)
 
400
 
401
  model_dir = Path(args.model_dir)
402
  in_encoder = model_dir / "encoder-model.onnx"