[Bugfix]: modify diffusion pipeline profiler result in videos (#2647)
Signed-off-by: bjf-frz <frz123db@gmail.com>
This commit is contained in:
1 parent
c2ae58bb84
commit
fbb5dd5794
6 files changed
+158
-30
No files matched your search
@@ -2009,6 +2009,8 @@ async def _run_video_generation_job(
|
||||
"file_name": file_name,
|
||||
"completed_at": int(time.time()),
|
||||
"inference_time_s": time.perf_counter() - started_at,
|
||||
"stage_durations": response.stage_durations,
|
||||
"peak_memory_mb": response.peak_memory_mb,
|
||||
},
|
||||
)
|
||||
except Exception as exc:
|
||||
@@ -2182,7 +2184,7 @@ async def create_video_sync(
|
||||
request_id = f"video_sync-{random_uuid()}"
|
||||
started_at = time.perf_counter()
|
||||
try:
|
||||
video_bytes = await asyncio.wait_for(
|
||||
video_bytes, stage_durations, peak_memory_mb = await asyncio.wait_for(
|
||||
handler.generate_video_bytes(request, request_id, reference_image=reference_image),
|
||||
timeout=VIDEO_SYNC_TIMEOUT_S,
|
||||
)
|
||||
@@ -2208,6 +2210,8 @@ async def create_video_sync(
|
||||
"X-Request-Id": request_id,
|
||||
"X-Model": effective_model_name,
|
||||
"X-Inference-Time-S": f"{inference_time_s:.3f}",
|
||||
"X-Stage-Durations": json.dumps(stage_durations, separators=(",", ":")),
|
||||
"X-Peak-Memory-MB": f"{peak_memory_mb:.3f}",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user