Open Zoher15 opened 1 month ago
Great note @Zoher15 , are you trying to avoid repeating the KNN indexing of the trainset every time?
This is actually pretty fundamental. It's not trivial to figure out how to save a KNNFewShot program.
@okhat So my understanding is that predict/knn simply takes the inputs and finds the K centroids from training. If that is the case, then it is not really a teleprompter/optimizer? It is just a great way to sample examples and something that could actually work with other optimizer/teleprompters? I could see myself bootstrapping these specific centroids from a teacher model for instance. And in that case, yes it would be great to be able to save the centroid and avoid indexing every time.
Hi @Zoher15 , would saving the state of the KNN model via self.KNN.trainset_vectors
suffice here?
Hi,
I tried the following but just got an empty json:
This would help in not having to repeat the knn search everytime?