From c8d28a806f491d6387708d2fe64c23a80f9cd2f4 Mon Sep 17 00:00:00 2001 From: minhtrung23 Date: Fri, 20 Sep 2024 18:10:01 +0700 Subject: [PATCH] Delete src/melt/tools/pipelines/run.py --- src/melt/tools/pipelines/run.py | 49 --------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/melt/tools/pipelines/run.py diff --git a/src/melt/tools/pipelines/run.py b/src/melt/tools/pipelines/run.py deleted file mode 100644 index f6c8b72..0000000 --- a/src/melt/tools/pipelines/run.py +++ /dev/null @@ -1,49 +0,0 @@ -"Run" -from typing import NamedTuple, Optional, Callable -from dataclasses import dataclass -import torch -@dataclass -class RunConfig: - "class" - generation_results_file: str - saving_fn: Callable - start_idx: int = 0 - few_shot: bool = False - continue_infer: Optional[object] = None - -class RunParams(NamedTuple): - "class" - ds_wrapper: object - ds_loader: object - config: RunConfig - -class Pipeline: - "class" - def additional_method(self): - """ - Another public method to satisfy the two-method requirement. - """ - print("") - def __init__(self): - self.generation_results_file = None - self.continue_infer_data = None - self.few_shot = None - def run(self, params: RunParams): - "run" - # Extract configuration from params - config = params.config - self.generation_results_file = config.generation_results_file - self.continue_infer_data = config.continue_infer - self.few_shot = config.few_shot - # Ensure no gradients are computed - with torch.no_grad(): - # Call internal processing method without capturing return value - self._process(params.ds_wrapper, params.ds_loader, config.saving_fn, config.start_idx) - - def _process(self, ds_wrapper, ds_loader, saving_fn, start_idx): - # Implement the processing logic here - # For example: - # 1. Fetch data using ds_wrapper and ds_loader - # 2. Save results using saving_fn - # 3. Use start_idx for initialization or data slicing - pass