Skip to content

Commit 43c7e5f

Browse files
authored
feat: Improve distill for modernBERT (#165)
* feat: token mean and sif weighting * revert sif weighting
1 parent b41c3be commit 43c7e5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model2vec/distill/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def create_output_embeddings_from_model(
159159
out = out.float()
160160

161161
# Add the output to the intermediate weights
162-
intermediate_weights.append(out[:, 1].detach().cpu().numpy())
162+
intermediate_weights.append(out.mean(1).detach().cpu().numpy())
163163

164164
# Concatenate the intermediate weights
165165
out_weights = np.concatenate(intermediate_weights)

0 commit comments

Comments
 (0)