Buckets:
| from typing import Dict, Any, Union, List, Optional | |
| from dataclasses import dataclass, field | |
| class ModelArgs: | |
| model_name_or_path: str = "gpt2" | |
| device: str = "cpu" | |
| learning_rate: float = 5e-4 | |
| ttt_epochs: int = 10 | |
| max_length: Optional[int] = 128 | |
| lora_rank: int = 8 | |
| lora_alpha: int = 16 | |
| target_modules: List[str] = field(default_factory=lambda: ["c_attn"]) | |
| def _apply_dict(self, d: Dict[str, Any]) -> None: | |
| if not isinstance(d, dict): | |
| return | |
| for key, val in d.items(): | |
| if hasattr(self, key): | |
| setattr(self, key, val) | |
| class DataArgs: | |
| name: str = "demo_reverse_lastchar" | |
| demonstrations: List[str] = field( | |
| default_factory=lambda: ["hello", "world", "apple", "python"] | |
| ) | |
| def _apply_dict(self, d: Dict[str, Any]) -> None: | |
| if not isinstance(d, dict): | |
| return | |
| for key, val in d.items(): | |
| if hasattr(self, key): | |
| setattr(self, key, val) | |
| class EvaluatorArgs: | |
| use_wandb: bool = False | |
| project: Optional[str] = None | |
| entity: Optional[str] = None | |
| def _apply_dict(self, d: Dict[str, Any]) -> None: | |
| if not isinstance(d, dict): | |
| return | |
| for key, val in d.items(): | |
| if hasattr(self, key): | |
| setattr(self, key, val) | |
Xet Storage Details
- Size:
- 1.37 kB
- Xet hash:
- 2e61de065515260589ab4579d18fc3fad8487823c96bfc9e3d842959da91058b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.