[diffusion] chore: minor code cleanups and improve logging (#14916)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user