You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Distill a staticmodel from a sentence transformer.
@@ -55,7 +55,7 @@ def distill_from_model(
55
55
If the pattern is so general that it removes all tokens, we throw an error. If the pattern can't be compiled into a valid regex, we also throw an error.
56
56
:param quantize_to: The data type to quantize to. Can be any of the DType enum members or their string equivalents.
57
57
:param vocabulary_quantization: The number of clusters to use for vocabulary quantization. If this is None, no quantization is performed.
58
-
:param pooling: The pooling strategy to use for creating embeddings. Can be one of:
58
+
:param pooling: The pooling mode to use for creating embeddings. Can be one of:
59
59
'mean' (default): mean over all tokens. Robust and works well in most cases.
60
60
'last': use the last token's hidden state (often the [EOS] token). Common for decoder-style models.
61
61
'first': use the first token's hidden state ([CLS] token in BERT-style models).
@@ -209,7 +209,7 @@ def distill(
209
209
trust_remote_code: bool=False,
210
210
quantize_to: DType|str=DType.Float16,
211
211
vocabulary_quantization: int|None=None,
212
-
pooling: PoolingType=PoolingType.MEAN,
212
+
pooling: PoolingMode=PoolingMode.MEAN,
213
213
) ->StaticModel:
214
214
"""
215
215
Distill a staticmodel from a sentence transformer.
@@ -232,7 +232,7 @@ def distill(
232
232
:param trust_remote_code: Whether to trust the remote code. If this is False, we will only load components coming from `transformers`. If this is True, we will load all components.
233
233
:param quantize_to: The data type to quantize to. Can be any of the DType enum members or their string equivalents.
234
234
:param vocabulary_quantization: The number of clusters to use for vocabulary quantization. If this is None, no quantization is performed.
235
-
:param pooling: The pooling strategy to use for creating embeddings. Can be one of:
235
+
:param pooling: The pooling mode to use for creating embeddings. Can be one of:
236
236
'mean' (default): mean over all tokens. Robust and works well in most cases.
237
237
'last': use the last token's hidden state (often the [EOS] token). Common for decoder-style models.
238
238
'first': use the first token's hidden state ([CLS] token in BERT-style models).
0 commit comments