Skip to content

Commit

Permalink
throw error if training_iter0_model_path is not found (#1391)
Browse files Browse the repository at this point in the history
Fix #622.

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Nov 7, 2023
1 parent 1bb42c9 commit eebdb37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def make_train(iter_index, jdata, mdata):
% numb_models
)
for ii in range(len(iter0_models)):
old_model_files = glob.glob(os.path.join(iter0_models[ii], "model.ckpt*"))
old_model_path = os.path.join(iter0_models[ii], "model.ckpt*")
old_model_files = glob.glob(old_model_path)
if not len(old_model_files):
raise FileNotFoundError(f"{old_model_path} not found!")
_link_old_models(work_path, old_model_files, ii)
copied_models = next(
(
Expand Down

0 comments on commit eebdb37

Please sign in to comment.