Reset configuration.
(self)
| 801 | self.model_config = json.load(open(self.config_path, "r", encoding="utf-8")) |
| 802 | |
| 803 | def reset(self): |
| 804 | """ |
| 805 | Reset configuration. |
| 806 | """ |
| 807 | |
| 808 | def reset_value(cls, value_name, key=None, default=None): |
| 809 | if key is not None and key in cls.model_config: |
| 810 | setattr(cls, value_name, cls.model_config[key]) |
| 811 | elif getattr(cls, value_name, None) is None: |
| 812 | setattr(cls, value_name, default) |
| 813 | |
| 814 | if not self.enabled_speculative_decoding(): |
| 815 | return |
| 816 | |
| 817 | # NOTE(liuzichang): We will support multi-layer in future |
| 818 | if self.method in ["mtp"]: |
| 819 | self.num_extra_cache_layer = 1 |
| 820 | |
| 821 | def enabled_speculative_decoding(self): |
| 822 | """ |
no test coverage detected