Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pymilvus import error message in PyCharm for milvus_model #2562

Open
codingjaguar opened this issue Jan 14, 2025 · 0 comments
Open

pymilvus import error message in PyCharm for milvus_model #2562

codingjaguar opened this issue Jan 14, 2025 · 0 comments

Comments

@codingjaguar
Copy link
Contributor

Another question regarding https://milvus.io/docs/full_text_search_with_milvus.md

from pymilvus.model.hybrid import BGEM3EmbeddingFunction

This code runs fine, but in my Pycharm, it always displays 'hybrid' and 'BGEM3EmbeddingFunction' unavailable. I searched the libraries, and found:

ls venv/lib/python3.10/site-packages/milvus_model/hybrid/         
__init__.py     __pycache__     bge_m3.py       mgte.py

ls venv/lib/python3.10/site-packages/pymilvus/model/__init__.py 
venv/lib/python3.10/site-packages/pymilvus/model/__init__.py

So the module is actually defined and exported under "milvus_model/hybrid/init.py ", not "pymilvus/model/init.py", so I changed the import to:

from milvus_model.hybrid import BGEM3EmbeddingFunction

The tutorial results work exactly the same as "from pymilvus.model.hybrid import BGEM3EmbeddingFunction". But the change gets rid of the import error message in PyCharm. Is this good?

@codingjaguar can help on answering this question

Originally posted by @xiaofan-luan in milvus-io/milvus#36226 (reply in thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant