lmcinnes / pynndescent

A Python nearest neighbor descent for approximate nearest neighbors
BSD 2-Clause "Simplified" License
899 stars 105 forks source link

Reset distance function in __setstate__ #240

Closed smartIU closed 6 months ago

smartIU commented 6 months ago

Resetting the distance function in setstate, so evaluations like "dist == pynnd_dist.bit_hamming" work as intended after unpickle. Otherwise trying to load a pickled model with bitpacked vectors will fail in _init_search_function.

lmcinnes commented 6 months ago

Great work, thank you!