From 7616695732e875e4d862b6d263943c23a73918cc Mon Sep 17 00:00:00 2001 From: LuLu Zuo Date: Fri, 8 Sep 2023 17:49:18 +0800 Subject: [PATCH] move import to header --- .../promptflow/executor/_line_execution_process_pool.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/promptflow/promptflow/executor/_line_execution_process_pool.py b/src/promptflow/promptflow/executor/_line_execution_process_pool.py index 12fbe105829..d53a1d975ab 100644 --- a/src/promptflow/promptflow/executor/_line_execution_process_pool.py +++ b/src/promptflow/promptflow/executor/_line_execution_process_pool.py @@ -1,6 +1,9 @@ import contextvars import multiprocessing import queue +import math +import os +import psutil from datetime import datetime from functools import partial from logging import INFO @@ -363,11 +366,6 @@ def create_executor_legacy(*, flow, connections, loaded_tools, cache_manager, st def get_available_max_worker_count(): - import math - import os - - import psutil - pid = os.getpid() mem_info = psutil.virtual_memory() total_memory = mem_info.total / (1024 * 1024) # in MB