refactor: Config序列化统一BaseConfig基类
- 新增astrai/config/base.py,提供to_dict/from_dict基类 - 统一命名:load/save → from_file/to_file - Checkpoint.meta合并训练配置到meta.json - sys.stderr.warn → warnings.warn - from_file改为classmethod
This commit is contained in:
@@ -235,10 +235,8 @@ def train(
|
||||
assert os.path.exists(param_path)
|
||||
|
||||
# Load config
|
||||
config = ModelConfig()
|
||||
config_path = os.path.join(param_path, "config.json")
|
||||
if os.path.exists(config_path):
|
||||
config.load(config_path)
|
||||
config = ModelConfig.from_file(config_path)
|
||||
|
||||
if window_size is None:
|
||||
window_size = config.max_len
|
||||
|
||||
Reference in New Issue
Block a user