Skip to content

Add Preprocess Module to SingleTaskLearning Paradigm​ #208

@IcyFeather233

Description

@IcyFeather233

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:

  1. Handle initialization tasks (e.g., loading a RAG knowledge base, data preprocessing, etc.).
  2. Be optional—if not implemented by a subclass, it should silently skip without affecting existing workflows.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions