Problem Statement
Currently, the SingleTaskLearning algorithm in ianvs lacks an initialization/preprocessing step before _train() is called. This can be problematic in scenarios like RAG (Retrieval-Augmented Generation), where a knowledge base must be initialized before training or inference begins.
For reference, the current _train() implementation starts directly without any preprocessing:
https://github.com/kubeedge/ianvs/blob/main/core/testcasecontroller/algorithm/paradigm/singletask_learning/singletask_learning.py#L58
Proposed Solution
Introduce a _preprocess() method in the SingleTaskLearning paradigm, which will be called before _train() or _inference(). This method should:
- Handle initialization tasks (e.g., loading a RAG knowledge base, data preprocessing, etc.).
- Be optional—if not implemented by a subclass, it should silently skip without affecting existing workflows.
Problem Statement
Currently, the
SingleTaskLearningalgorithm in ianvs lacks an initialization/preprocessing step before_train()is called. This can be problematic in scenarios like RAG (Retrieval-Augmented Generation), where a knowledge base must be initialized before training or inference begins.For reference, the current
_train()implementation starts directly without any preprocessing:https://github.com/kubeedge/ianvs/blob/main/core/testcasecontroller/algorithm/paradigm/singletask_learning/singletask_learning.py#L58
Proposed Solution
Introduce a
_preprocess()method in the SingleTaskLearning paradigm, which will be called before_train()or_inference(). This method should: