-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:
DataLoaderInfo
dataclass (#606)
- Loading branch information
1 parent
ecdd576
commit cbd1006
Showing
1 changed file
with
18 additions
and
28 deletions.
There are no files selected for viewing
46 changes: 18 additions & 28 deletions
46
modyn/supervisor/internal/triggers/utils/datasets/dataloader_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
# TODO(415): Unify with similar classes in trainer_server and evaluator | ||
|
||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class DataLoaderInfo: | ||
def __init__( | ||
self, | ||
pipeline_id: int, | ||
dataset_id: str, | ||
num_dataloaders: int, | ||
batch_size: int, | ||
bytes_parser: str, | ||
transform_list: list[str], | ||
storage_address: str, | ||
selector_address: str, | ||
num_prefetched_partitions: int, | ||
parallel_prefetch_requests: int, | ||
shuffle: bool, | ||
tokenizer: str | None, | ||
): | ||
self.pipeline_id = pipeline_id | ||
self.dataset_id = dataset_id | ||
self.num_dataloaders = num_dataloaders | ||
self.batch_size = batch_size | ||
self.bytes_parser = bytes_parser | ||
self.transform_list = transform_list | ||
self.storage_address = storage_address | ||
self.selector_address = selector_address | ||
self.num_prefetched_partitions = num_prefetched_partitions | ||
self.parallel_prefetch_requests = parallel_prefetch_requests | ||
self.tokenizer = tokenizer | ||
self.training_id = -1 | ||
self.shuffle = shuffle | ||
pipeline_id: int | ||
dataset_id: str | ||
num_dataloaders: int | ||
batch_size: int | ||
bytes_parser: str | ||
transform_list: list[str] | ||
storage_address: str | ||
selector_address: str | ||
num_prefetched_partitions: int | ||
parallel_prefetch_requests: int | ||
shuffle: bool | ||
tokenizer: str | None = None | ||
training_id: int = -1 |