Database for AI. Store Vectors, Images, Texts, Videos, etc. Use with LLMs/LangChain. Store, query, version, & visualize any AI data. Stream data in real-time to PyTorch/TensorFlow. https://activeloop.ai
[X] Enhancement/New feature (adds functionality without impacting existing logic)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
By default, tensors with htype="class_label" will accept any new values added to them. This PR adds a new allow_new_labels=False setting in the tensor "info" which changes that behavior to instead throw an exception if an unknown label is added.
The available labels are set in the info["class_names"] setting, either when the tensor is originally created:
If you update the class_names to be a different order or skipping existing labels, the label_id->text mapping will be off and reading from the tensor will give you incorrect results.
π π Pull Request
Impact
Description
By default, tensors with htype="class_label" will accept any new values added to them. This PR adds a new
allow_new_labels=False
setting in the tensor "info" which changes that behavior to instead throw an exception if an unknown label is added.The available labels are set in the
info["class_names"]
setting, either when the tensor is originally created:or set/updated later:
Things to be aware of
If you update the class_names to be a different order or skipping existing labels, the label_id->text mapping will be off and reading from the tensor will give you incorrect results.