Place model to device, or to DDP
(self)
| 293 | self.model = Swift.prepare_model(self.model, efficient_tuners) |
| 294 | |
| 295 | def place_model(self): |
| 296 | """Place model to device, or to DDP |
| 297 | """ |
| 298 | if self.device.type == 'cuda': |
| 299 | self.model.to(self.device) |
| 300 | if not is_parallel(self.model) and self._dist: |
| 301 | self.model = self.to_parallel(self.model) |
| 302 | |
| 303 | def get_data_collator(self, data_collator, remove_unused_data=False): |
| 304 | """Get the data collator for both training and evaluating. |
nothing calls this directly
no test coverage detected