| |
|
| |
|
| | from transformers import PretrainedConfig |
| | from typing import List |
| |
|
| |
|
| | class CloudConfig(PretrainedConfig): |
| | |
| |
|
| | def __init__( |
| | self, |
| | block_type="bottleneck", |
| | |
| | num_classes: int = 10, |
| | |
| | cardinality: int = 1, |
| | base_width: int = 64, |
| | stem_width: int = 64, |
| | stem_type: str = "", |
| | avg_down: bool = False, |
| | **kwargs, |
| | ): |
| | if block_type not in ["basic", "bottleneck"]: |
| | raise ValueError(f"`block_type` must be 'basic' or bottleneck', got {block_type}.") |
| | if stem_type not in ["", "deep", "deep-tiered"]: |
| | raise ValueError(f"`stem_type` must be '', 'deep' or 'deep-tiered', got {stem_type}.") |
| |
|
| | self.block_type = block_type |
| | |
| | self.num_classes = num_classes |
| | |
| | self.cardinality = cardinality |
| | self.base_width = base_width |
| | self.stem_width = stem_width |
| | self.stem_type = stem_type |
| | self.avg_down = avg_down |
| | super().__init__(**kwargs) |
| |
|