fix int conversion for SGLANG_CPU_COUNT (#1803)

This commit is contained in:
Byron Hsu
2024-10-26 00:09:44 -07:00
committed by GitHub
parent 07bf2e846a
commit c26507484f

View File

@@ -36,11 +36,12 @@ class BaseImageProcessor(ABC):
def __init__(self, hf_config, server_args, _processor):
self.hf_config = hf_config
self._processor = _processor
self.executor = concurrent.futures.ProcessPoolExecutor(
initializer=init_global_processor,
mp_context=mp.get_context("fork"),
initargs=(server_args,),
max_workers=os.environ.get("SGLANG_CPU_COUNT", os.cpu_count()),
max_workers=int(os.environ.get("SGLANG_CPU_COUNT", os.cpu_count())),
)
@abstractmethod
@@ -239,7 +240,7 @@ class Qwen2VLImageProcessor(BaseImageProcessor):
initializer=init_global_processor,
mp_context=mp.get_context("fork"),
initargs=(server_args,),
max_workers=os.environ.get("SGLANG_CPU_COUNT", os.cpu_count()),
max_workers=int(os.environ.get("SGLANG_CPU_COUNT", os.cpu_count())),
)
@staticmethod