Skip to content

Commit dfd9b5f

Browse files
authored
model-conversion : set pooling type to none in logits.cpp (ggml-org#15564)
This commit explicitly sets the pooling type to 'none' in the logits.cpp to support models that have a pooling type specified. The motivation for this is that some models may have a pooling type set in the model file (.gguf file) and for this specific case where we only want to extract logits, we need to ensure that no pooling is used to so that we are comparing raw logits and not pooled embeddings.
1 parent 5a6bc6b commit dfd9b5f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/model-conversion/logits.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ int main(int argc, char ** argv) {
112112
ctx_params.no_perf = false;
113113
if (embedding_mode) {
114114
ctx_params.embeddings = true;
115+
ctx_params.pooling_type = LLAMA_POOLING_TYPE_NONE;
115116
ctx_params.n_ubatch = ctx_params.n_batch;
116117
}
117118

0 commit comments

Comments
 (0)