Snapshot base kwargs for all submodules to allow reset before inference.
(self)
| 991 | return export_dir |
| 992 | |
| 993 | def _store_base_configs(self): |
| 994 | """Snapshot base kwargs for all submodules to allow reset before inference.""" |
| 995 | baseline = {} |
| 996 | for name in dir(self): |
| 997 | if not name.endswith("kwargs"): |
| 998 | continue |
| 999 | value = getattr(self, name, None) |
| 1000 | if isinstance(value, dict): |
| 1001 | baseline[name] = copy.deepcopy(value) |
| 1002 | # include primary kwargs explicitly |
| 1003 | baseline["kwargs"] = copy.deepcopy(self.kwargs) |
| 1004 | self._base_kwargs_map = baseline |
| 1005 | |
| 1006 | _IMMUTABLE_KWARGS_KEYS = frozenset([ |
| 1007 | "token_list", "tokenizer", "frontend", "model", "init_param", "model_path", |