Skip to content

Commit

Permalink
Use all available cores for data loading by default
Browse files Browse the repository at this point in the history
  • Loading branch information
atroyn committed Nov 7, 2023
1 parent 1824082 commit 5f8b197
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chromadb/utils/data_loaders.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import importlib
import multiprocessing
from typing import Optional, Sequence, List
import numpy as np
from chromadb.api.types import URI, DataLoader, Image
from concurrent.futures import ThreadPoolExecutor


class ImageLoader(DataLoader[List[Optional[Image]]]):
def __init__(self, max_workers: int = 4) -> None:
def __init__(self, max_workers: int = multiprocessing.cpu_count()) -> None:
try:
self._PILImage = importlib.import_module("PIL.Image")
self._max_workers = max_workers
Expand Down

0 comments on commit 5f8b197

Please sign in to comment.