From fa8d39d75add62e6f2edfde738da32338e12a59e Mon Sep 17 00:00:00 2001 From: Laurent Sorber Date: Mon, 23 Sep 2024 10:58:00 +0200 Subject: [PATCH] fix: add fallback for missing cpu_count --- tests/test_rag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rag.py b/tests/test_rag.py index e416923..e834e6b 100644 --- a/tests/test_rag.py +++ b/tests/test_rag.py @@ -11,7 +11,7 @@ def is_accelerator_available() -> bool: """Check if an accelerator is available.""" - return llama_supports_gpu_offload() or os.cpu_count() >= 8 # noqa: PLR2004 + return llama_supports_gpu_offload() or (os.cpu_count() or 1) >= 8 # noqa: PLR2004 def test_insert_index_search(raglite_test_config: RAGLiteConfig) -> None: