fix(trainer): 修复检查点回调参数顺序和权重保存选项

This commit is contained in:
2026-01-05 17:08:09 +08:00
parent eba99e1f5e
commit d21682f97a
4 changed files with 23 additions and 15 deletions
+3 -2
View File
@@ -52,10 +52,11 @@ class BaseModelIO:
self.config.load(str(paths["config"]))
self.tokenizer.load(str(paths["tokenizer"]))
if self.model is None:
self.model = Transformer(self.config)
if paths["model"].exists():
state_dict = st.load_file(str(paths["model"]))
if self.model is None:
self.model = Transformer(self.config)
self.model.load_state_dict(state_dict)
return self