Skip to content

Commit adf844d

Browse files
committed
[ENH] Embedding validation error message
1 parent 9c4e772 commit adf844d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

chromadb/api/types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def normalize_embeddings(
149149

150150
if len(target) == 0:
151151
raise ValueError(
152-
f"Expected Embeddings to be non-empty list or numpy array, got {target}"
152+
f"Expected embeddings to be non-empty list or numpy array, got {target}"
153153
)
154154

155155
if isinstance(target, list):
@@ -158,6 +158,8 @@ def normalize_embeddings(
158158
return [np.array(target, dtype=np.float32)]
159159
# List of PyEmbeddings
160160
if isinstance(target[0], list):
161+
if len(target[0]) == 0:
162+
raise ValueError("Expected embeddings to be at least 1-dimensional")
161163
if isinstance(target[0][0], (int, float)) and not isinstance(
162164
target[0][0], bool
163165
):

0 commit comments

Comments
 (0)