MaartenGr / MaartenGr/BERTopic
Issue with loading BERTopic model. 'NNDescent' object has no attribute '_bit_trees'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 920
- Avg merge
- 22h 24m
- Merged PRs (30d)
- 5
Description
The code:
```
from bertopic import BERTopic
model_path = "/path/to/bertopic/model"
model = BERTopic.load(model_path)
```
The error:
`AttributeError: 'NNDescent' object has no attribute '_bit_trees'`
The solution:
I downgraded my pynndescent from 0.5.12 to 0.5.11. That solved the problem, but just bringing this to your attention in case there's a change that needs to be made moving forward.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the BERTopic.load example in the issue and reproduce it with pynndescent 0.5.12, then compare it with 0.5.11. Trace the model-loading path around NNDescent to identify the compatibility boundary and add or update a regression test if one exists. Done means the shown model loads without the reported AttributeError under the supported dependency version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100