fix : start_epoch/start_batch 由用户参数决定,不再被 checkpoint 覆盖
This commit is contained in:
parent
e371908b54
commit
3a28e52e98
|
|
@ -80,8 +80,8 @@ class TrainContextBuilder:
|
||||||
state_dict = load_model_weights(self._resume_dir)
|
state_dict = load_model_weights(self._resume_dir)
|
||||||
model.load_state_dict(state_dict, strict=False)
|
model.load_state_dict(state_dict, strict=False)
|
||||||
if checkpoint is not None:
|
if checkpoint is not None:
|
||||||
context.epoch = max(checkpoint.epoch, cfg.start_epoch)
|
context.epoch = cfg.start_epoch
|
||||||
context.iteration = max(checkpoint.iteration, cfg.start_batch)
|
context.iteration = cfg.start_batch
|
||||||
context.checkpoint = checkpoint
|
context.checkpoint = checkpoint
|
||||||
|
|
||||||
if cfg.lora is not None:
|
if cfg.lora is not None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue