From c26507484fca9c6a901754b16af56285df29aa2b Mon Sep 17 00:00:00 2001 From: Byron Hsu Date: Sat, 26 Oct 2024 00:09:44 -0700 Subject: [PATCH] fix int conversion for `SGLANG_CPU_COUNT` (#1803) --- python/sglang/srt/managers/image_processor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/managers/image_processor.py b/python/sglang/srt/managers/image_processor.py index 08ad15023..b24b761a2 100644 --- a/python/sglang/srt/managers/image_processor.py +++ b/python/sglang/srt/managers/image_processor.py @@ -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