[diffusion] chore: minor code cleanups and improve logging (#14916)

This commit is contained in:
Mick
2025-12-12 18:48:07 +08:00
committed by GitHub
parent 94e1251131
commit 82e33170e1
9 changed files with 40 additions and 78 deletions

View File

@@ -1,7 +1,6 @@
# Copied and adapted from: https://github.com/hao-ai-lab/FastVideo
import dataclasses
import json
import logging
import os
import subprocess
import sys
@@ -223,10 +222,9 @@ class PerformanceLogger:
os.makedirs(os.path.dirname(abs_path), exist_ok=True)
with open(abs_path, "w", encoding="utf-8") as f:
json.dump(report, f, indent=2)
print(f"[Performance] Metrics dumped to: {abs_path}")
logger.info(f"[Performance] Metrics dumped to: {abs_path}")
except IOError as e:
print(f"[Performance] Failed to dump metrics to {abs_path}: {e}")
logging.getLogger(__name__).error(f"Dump failed: {e}")
logger.error(f"[Performance] Failed to dump metrics to {abs_path}: {e}")
@classmethod
def log_request_summary(