Skip to content

[CHORE] Fix typing on empty configuration json returned, remove validation on num_threads in python #4325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions chromadb/api/collection_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion chromadb/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -153,7 +155,8 @@ def get_configuration(self) -> CollectionConfiguration:
stacklevel=2,
)
return CollectionConfiguration(
hnsw={},
hnsw=HNSWConfiguration(),
spann=SpannConfiguration(),
embedding_function=None,
)

Expand Down
Loading