From 19ace801237bcbedcb9799078ded7b82b14910bb Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sat, 19 Sep 2026 14:55:19 +0800 Subject: [PATCH] =?UTF-8?q?style(gpu):=20black/ruff=20=E6=95=B4=E7=90=86?= =?UTF-8?q?=EF=BC=88=E9=A1=BA=E5=B8=A6=E7=A7=BB=E9=99=A4=20worker=20?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=20import=20json=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/gpu_worker/gpu_worker.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/deploy/gpu_worker/gpu_worker.py b/deploy/gpu_worker/gpu_worker.py index 72bb73aed..a3ace3b11 100644 --- a/deploy/gpu_worker/gpu_worker.py +++ b/deploy/gpu_worker/gpu_worker.py @@ -22,7 +22,6 @@ from __future__ import annotations -import json import logging import os import platform @@ -200,9 +199,7 @@ def _download(url: str, path: Path) -> bool: return False -def _call_musetalk( - video_path: Path, audio_path: Path, out_path: Path -) -> tuple[bool, float, str, bool]: +def _call_musetalk(video_path: Path, audio_path: Path, out_path: Path) -> tuple[bool, float, str, bool]: """调用本地 MuseTalk /inference. 返回 (success, duration_seconds, error_msg, retryable)。 @@ -245,9 +242,13 @@ def _probe_duration(path: Path) -> float: out = subprocess.check_output( [ - "ffprobe", "-v", "error", - "-show_entries", "format=duration", - "-of", "default=noprint_wrappers=1:nokey=1", + "ffprobe", + "-v", + "error", + "-show_entries", + "format=duration", + "-of", + "default=noprint_wrappers=1:nokey=1", str(path), ], stderr=subprocess.DEVNULL,