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:
2026-05-16 22:06:39 +08:00
parent d7a7f570ed
commit f91bfee33e
11 changed files with 126 additions and 84 deletions
+1
View File
@@ -125,6 +125,7 @@ class CheckpointCallback(TrainCallback):
epoch=context.epoch,
iteration=context.iteration,
extra=extra,
meta=context.config.to_dict(),
)
context.checkpoint.save(save_path)