From b6cf1daa3765a927840303fdbe7971f442465d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perceval=20Wajsb=C3=BCrt?= Date: Sun, 19 May 2024 15:45:57 +0200 Subject: [PATCH] fix: make new env var EDSNLP_MAX_CPU_WORKERS is optional --- edsnlp/processing/multiprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edsnlp/processing/multiprocessing.py b/edsnlp/processing/multiprocessing.py index 82d7e3d3a..b173652ae 100644 --- a/edsnlp/processing/multiprocessing.py +++ b/edsnlp/processing/multiprocessing.py @@ -796,7 +796,7 @@ def execute_multiprocessing_backend( and num_gpu_workers > 0 ) - num_cpus = int(os.environ["EDSNLP_MAX_CPU_WORKERS"] or cpu_count()) + num_cpus = int(os.environ.get("EDSNLP_MAX_CPU_WORKERS") or cpu_count()) num_devices = 0 if requires_gpu: import torch