From 11db348397709e02b108441c026df2c8a75e6ee8 Mon Sep 17 00:00:00 2001 From: stephantul Date: Thu, 16 Apr 2026 15:59:31 +0200 Subject: [PATCH] don't set weights for non-quantized models --- model2vec/distill/distillation.py | 2 ++ 1 file changed, 2 insertions(+) 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)