Skip to content

Commit

Permalink
fix: add fallback for missing cpu_count
Browse files Browse the repository at this point in the history
  • Loading branch information
lsorber committed Sep 23, 2024
1 parent e11d880 commit fa8d39d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fa8d39d

Please sign in to comment.