diff --git a/gradio_ui.py b/gradio_ui.py index 9d3e37f..e4d07c2 100644 --- a/gradio_ui.py +++ b/gradio_ui.py @@ -100,28 +100,26 @@ def run_eval( def stop_eval(): global current_process, should_stop should_stop = True - - killed_pids = [] + killed = [] try: for proc in psutil.process_iter(["pid", "name", "cmdline"]): try: - cmdline = " ".join(proc.info["cmdline"]) - if "evalscope" in cmdline and "perf" in cmdline: - killed_pids.append(proc.pid) + cmdline = proc.info["cmdline"] + if cmdline and "evalscope" in " ".join(cmdline): + killed.append(proc.pid) proc.kill() except (psutil.NoSuchProcess, psutil.AccessDenied): continue - if killed_pids: + if killed: current_process = None - return f"[Force killed evalscope processes: {killed_pids}]\n" + return f"[✅ 强制终止 evalscope PIDs: {killed}]\n" else: - return "[No evalscope process found]\n" + return "[⚠️ 未发现可杀的 evalscope 进程]\n" except Exception as e: - return f"[Error in stop_eval()] {e}\n" - + return f"[❌ 停止失败: {e}]\n"