Skip to content

[FEATURE] Why not Batch Predict? #4276

@urmichm

Description

@urmichm

Is your feature request related to a problem?
TextSimilarityCrossEncoderModel predictions are performed one by one inside a loop using getPredictor().predict(input) rather than processing the inputs in batches using batchPredict(listOfInputs)

This approach looks inefficient. Is there a specific reason for processing the predictions one by one?

To my understanding, Predictor.java creates internally a list/batch with a single element and calls batchPredict anyway.

Similar behaviour is presented on TextEmbeddingModel

What solution would you like?
Use batchProcessing to improve efficiency

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions