From 35251dbd1a4798684585c3f5784fc83f2c0140e5 Mon Sep 17 00:00:00 2001 From: Jai Radhakrishnan Date: Fri, 18 Apr 2025 14:52:39 -0700 Subject: [PATCH] [CHORE] Fix typing on empty configuration json returned --- chromadb/api/collection_configuration.py | 8 -------- chromadb/types.py | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/chromadb/api/collection_configuration.py b/chromadb/api/collection_configuration.py index a8913b93272..89a35b1fd3c 100644 --- a/chromadb/api/collection_configuration.py +++ b/chromadb/api/collection_configuration.py @@ -475,10 +475,6 @@ def validate_create_hnsw_config( if config["batch_size"] > config["sync_threshold"]: raise ValueError("batch_size must be less than or equal to sync_threshold") if "num_threads" in config: - if config["num_threads"] > cpu_count(): - raise ValueError( - "num_threads must be less than or equal to the number of available threads" - ) if config["num_threads"] <= 0: raise ValueError("num_threads must be greater than 0") if "resize_factor" in config: @@ -535,10 +531,6 @@ def validate_update_hnsw_config( if config["ef_search"] <= 0: raise ValueError("ef_search must be greater than 0") if "num_threads" in config: - if config["num_threads"] > cpu_count(): - raise ValueError( - "num_threads must be less than or equal to the number of available threads" - ) if config["num_threads"] <= 0: raise ValueError("num_threads must be greater than 0") if "batch_size" in config and "sync_threshold" in config: diff --git a/chromadb/types.py b/chromadb/types.py index 9a4d797d889..66e96ded9ba 100644 --- a/chromadb/types.py +++ b/chromadb/types.py @@ -16,6 +16,8 @@ from chromadb.serde import BaseModelJSONSerializable from chromadb.api.collection_configuration import ( CollectionConfiguration, + HNSWConfiguration, + SpannConfiguration, collection_configuration_to_json, load_collection_configuration_from_json, ) @@ -153,7 +155,8 @@ def get_configuration(self) -> CollectionConfiguration: stacklevel=2, ) return CollectionConfiguration( - hnsw={}, + hnsw=HNSWConfiguration(), + spann=SpannConfiguration(), embedding_function=None, )