(self, config=None)
| 66 | """Mock model for testing.""" |
| 67 | |
| 68 | def __init__(self, config=None): |
| 69 | if config is None: |
| 70 | from transformers import PretrainedConfig |
| 71 | |
| 72 | config = PretrainedConfig() |
| 73 | config.hidden_size = 768 |
| 74 | super().__init__(config) |
| 75 | self.config = config |
| 76 | import torch |
| 77 | |
| 78 | self.dummy_param = torch.nn.Parameter(torch.zeros(1)) |
| 79 | self._modules = {} # Required for nn.Module |
| 80 | self._device = torch.device("cpu") # Internal device storage |
| 81 | |
| 82 | @property |
| 83 | def device(self): |