private EmbeddingResult evaluate(Context context, String text, boolean isQuery) {
        var start = System.nanoTime();
        var encoding = tokenizer.encode(text, context.getLanguage());
        runtime.sampleSequenceLength(encoding.ids().size(), context);
        TransformerInput input = buildTransformerInput(encoding.ids(), isQuery ? maxQueryTokens : maxDocumentTokens, isQuery);
        Tensor inputIdsTensor = createTensorRepresentation(input.inputIds, "d1");
        Tensor attentionMaskTensor = createTensorRepresentation(input.attentionMask, "d1");
        var inputs = Map.of(inputIdsName,
                            inputIdsTensor.expand("d0"),
                            attentionMaskName, attentionMaskTensor.expand("d0"));
        Map<String, Tensor> outputs = evaluator.evaluate(inputs);
        runtime.sampleEmbeddingLatency((System.nanoTime() - start) / 1_000_000d, context);
        return new EmbeddingResult(input.inputIds.size(), outputs);
    }
Evaluate the embedding model if the result is not present in the context cache.

@param context the context accompanying the request
@param text the text that is embedded
@return the model output
model-integration/src/main/java/ai/vespa/embedding/ColBertEmbedder.java