Update bageldb.py (#11421)

I have restructured the code to ensure uniform handling of ImportError.
In place of previously used ValueError, I've adopted the standard
practice of raising ImportError with explanatory messages. This
modification enhances code readability and clarifies that any problems
stem from module importation.
This commit is contained in:
Aashish Saini 2023-10-06 01:07:56 +05:30 committed by GitHub
parent bfd48925e5
commit 2abbdc6ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,7 +108,7 @@ class Bagel(VectorStore):
try:
import bagel # noqa: F401
except ImportError:
raise ValueError("Please install bagel `pip install betabageldb`.")
raise ImportError("Please install bagel `pip install betabageldb`.")
return self._cluster.find(
query_texts=query_texts,
query_embeddings=query_embeddings,