(self, refit_dict: dict)
| 75 | return out |
| 76 | |
| 77 | def apply_loras(self, refit_dict: dict): |
| 78 | if not self.refitted_keys.issubset(set(refit_dict.keys())): |
| 79 | # Need to ensure that weights that have been modified before and are not present anymore are reset. |
| 80 | self.refitted_keys = set() |
| 81 | self.switch_engine() |
| 82 | |
| 83 | self.engine.refit_from_dict(refit_dict, is_fp16=True) |
| 84 | self.refitted_keys = set(refit_dict.keys()) |
| 85 | |
| 86 | def switch_engine(self): |
| 87 | self.loaded_config = self.configs[self.profile_idx] |
no test coverage detected