diff --git a/model2vec/distill/distillation.py b/model2vec/distill/distillation.py index 8bd6a5a..fd00a2e 100644 --- a/model2vec/distill/distillation.py +++ b/model2vec/distill/distillation.py @@ -118,6 +118,8 @@ def distill_from_model( else: # Post-process the embeddings. embeddings, weights = post_process_embeddings(np.asarray(embeddings), pca_dims, sif_coefficient=sif_coefficient) + embeddings = embeddings * weights[:, None] + weights = None token_mapping = None # Quantize the embeddings. embeddings = quantize_embeddings(embeddings, quantize_to)