File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,11 +233,6 @@ def fit(self, X: np.ndarray):
233233 rerank_factor = self .rerank_size_factor ,
234234 )
235235
236- # Clean up temporary data / graphs and wait briefly for threads/CPU to settle
237- del graph , X_f32 , quantized_features
238- gc .collect ()
239- time .sleep (5 )
240-
241236 def set_query_arguments (self , search_eps : float , rerank_size_factor : float = 1.0 ):
242237 """Sets query-time search_eps and rerank scaling factor."""
243238 self .search_eps = float (search_eps )
Original file line number Diff line number Diff line change @@ -830,13 +830,13 @@ class SearcherPy {
830830 if (buf.ndim != 1 && (buf.ndim != 2 || buf.shape [0 ] != 1 )) {
831831 throw std::invalid_argument (" search query must be 1D vector (or 1xDim 2D array)" );
832832 }
833- auto result = py::array_t <uint32_t >({ size_t (k)} );
833+ py::array_t <uint32_t > result ( static_cast <py:: ssize_t > (k));
834834 uint32_t * out_ptr = static_cast <uint32_t *>(result.request ().ptr );
835835
836836 py::array_t <float > dist_result;
837837 float * dist_ptr = nullptr ;
838838 if (return_distances) {
839- dist_result = py::array_t <float >({ size_t (k)} );
839+ dist_result = py::array_t <float >(static_cast <py:: ssize_t > (k));
840840 dist_ptr = static_cast <float *>(dist_result.request ().ptr );
841841 }
842842
You can’t perform that action at this time.
0 commit comments