Skip to content

Commit 9f620b0

Browse files
fix: fix find by vector of n_dim=1 (docarray#315)
Co-authored-by: Han Xiao <[email protected]>
1 parent 9e2f70e commit 9f620b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docarray/array/storage/qdrant/backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ def _map_embedding(self, embedding: 'ArrayType') -> List[float]:
187187
if embedding.ndim > 1:
188188
embedding = np.asarray(embedding).squeeze()
189189

190+
if embedding.ndim == 0: # scalar
191+
embedding = np.array([embedding])
192+
190193
if np.all(embedding == 0):
191194
embedding = embedding + EPSILON
192195
return embedding.tolist()

0 commit comments

Comments
 (0)