mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-06 15:48:39 +00:00
community[patch]: Fix bug in vdms (#19728)
**Description:** Fix embedding check in vdms **Contribution maintainer:** [@cwlacewe](https://github.com/cwlacewe)
This commit is contained in:
parent
75173d31db
commit
4a49fc5a95
@ -746,7 +746,8 @@ class VDMS(VectorStore):
|
||||
) -> Tuple[List[Dict[str, Any]], List]:
|
||||
all_blobs: List[Any] = []
|
||||
blob = embedding2bytes(query_embedding)
|
||||
all_blobs.append(blob)
|
||||
if blob is not None:
|
||||
all_blobs.append(blob)
|
||||
|
||||
if constraints is None:
|
||||
# K results returned
|
||||
@ -1534,7 +1535,7 @@ def _check_descriptor_exists_by_id(
|
||||
|
||||
def embedding2bytes(embedding: Union[List[float], None]) -> Union[bytes, None]:
|
||||
blob = None
|
||||
if embedding:
|
||||
if embedding is not None:
|
||||
emb = np.array(embedding, dtype="float32")
|
||||
blob = emb.tobytes()
|
||||
return blob
|
||||
|
Loading…
Reference in New Issue
Block a user