-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
AttributeError: type object 'hnswlib.Index' has no attribute 'file_handle_count' #1012
Comments
I am also running into this error. |
+1. same issue It seems a bug of chroma-hnswlib which depends by chromadb, downgrade to chromadb 0.4.3 solves the issue. |
Same error, however downgrading to 0.4.3 did not fix the issue for me. Trying to figure it out |
Same problem here. Is planned to solve this? How did you work around this error? Downgrading to 0.4.3 did not fix the issue for me neither. |
I am on Python 3.10.13 and downgrading to 0.4.3 fixed the issue for me. After downgrading this is what I have: Name: chromadb Name: hnswlib Name: chroma-hnswlib |
…e 'file_handle_count' as in zylon-ai/private-gpt#1012
The problem is caused by poorly commenting the line // PersistentLocalHnswSegment.get_file_handle_count() To solve this, you need to:
# PersistentLocalHnswSegment.get_file_handle_count() That should solve your problem. |
This worked for me fixed the issue I had with completing the >python ingest.py |
This worked for me! |
Hi folks - I don't think this is due to "poorly commenting" the line. The problem here is likely that you have both hnswlib and chroma-hnswlib in your env, we need to clean this up but hnswlib shadows chroma-hnswlib. Can you remove hnswlib from your env (using Sorry for the confusion. |
This worked for me - uninstalled "hnswlid" but kept "chroma-hnswlib". Just follow the hnswlib advise! |
I have tried uninstalling hnswlib and importing import chroma-hnswlib but it is giving me error |
Why is this closed? This issue is never solved properly. |
Still having issues ^^^ |
Still having issues. Tried the above
|
okay I figured it. It is primarily a path problem.
E.g. on my mac, I had
I ran "pip uninstall chromadb" and it removed the 2nd local_persistent_hnsw.py One should never go ahead and edit the installed files like someone had commented earlier. |
For me I uninstall both chroma-hnswlib and hnswlib. And installed again chroma-hnswlib.
|
Thx to yall for the trouble shoots! |
Cheers for this! This was also my problem. In my case I was using Poetry and after having installed both |
This solution is working for me. Though I am using python 3.8.10 |
Getting this error when running python ingest.py
(privategpt) D:\privategpt\privateGPT>python ingest.py
Traceback (most recent call last):
File "D:\privategpt\privateGPT\ingest.py", line 169, in
main()
File "D:\privategpt\privateGPT\ingest.py", line 146, in main
chroma_client = chromadb.PersistentClient(settings=CHROMA_SETTINGS , path=persist_directory)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb_init_.py", line 106, in PersistentClient
return Client(settings)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb_init_.py", line 143, in Client
api = system.instance(API)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\config.py", line 243, in instance
impl = type(self)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\api\segment.py", line 82, in init
self._manager = self.require(SegmentManager)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\config.py", line 184, in require
inst = self._system.instance(type)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\config.py", line 243, in instance
impl = type(self)
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\segment\impl\manager\local.py", line 73, in init
// PersistentLocalHnswSegment.get_file_handle_count()
File "C:\Users\Itanimulli\AppData\Local\Programs\Python\Python310\lib\site-packages\chromadb\segment\impl\vector\local_persistent_hnsw.py", line 405, in get_file_handle_count
hnswlib_count = hnswlib.Index.file_handle_count
AttributeError: type object 'hnswlib.Index' has no attribute 'file_handle_count'
The text was updated successfully, but these errors were encountered: