File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -8212,6 +8212,7 @@ struct llm_build_context {
8212
8212
cb(cur, "result_embd_pooled", -1);
8213
8213
} break;
8214
8214
case LLAMA_POOLING_TYPE_CLS:
8215
+ case LLAMA_POOLING_TYPE_LAST:
8215
8216
{
8216
8217
cur = ggml_get_rows(ctx0, cur, inp_cls);
8217
8218
cb(cur, "result_embd_pooled", -1);
@@ -8738,8 +8739,11 @@ struct llm_build_context {
8738
8739
// inp_pos - contains the positions
8739
8740
struct ggml_tensor * inp_pos = build_inp_pos();
8740
8741
8741
- // inp_cls - contains the CLS/SEP token
8742
- struct ggml_tensor * inp_cls = build_inp_cls();
8742
+ struct ggml_tensor * inp_cls = nullptr;
8743
+ if (cparams.embeddings) {
8744
+ // inp_cls - contains the CLS/SEP token
8745
+ inp_cls = build_inp_cls();
8746
+ }
8743
8747
8744
8748
// KQ_mask (mask for 1 head, it will be broadcasted to all heads)
8745
8749
struct ggml_tensor * KQ_mask = build_inp_KQ_mask();
You can’t perform that action at this time.
0 commit comments