Trait PredictorConfig
Source pub trait PredictorConfig {
// Required methods
fn model_name(&self) -> &str;
fn batch_size(&self) -> usize;
fn validate(&self) -> OcrResult<()>;
// Provided methods
fn validate_batch_size(&self) -> OcrResult<()> { ... }
fn validate_model_name(&self) -> OcrResult<()> { ... }
}
Expand description
Trait for predictor configurations.
This trait defines the interface for predictor configurations.
Gets the name of the model.
§Returns
The name of the model.
Gets the batch size.
§Returns
The batch size.
Validates the configuration.
§Returns
A Result indicating success or an error.
Validates the batch size.
§Returns
A Result indicating success or an error.
§Validation Rules
- Batch size must be greater than 0.
- Batch size should not exceed 1000 for memory efficiency.
Validates the model name.
§Returns
A Result indicating success or an error.
§Validation Rules
- Model name cannot be empty.